diff --git a/src/renderer/components/ft-input/ft-input.js b/src/renderer/components/ft-input/ft-input.js index 9ff3b1fb..82c04562 100644 --- a/src/renderer/components/ft-input/ft-input.js +++ b/src/renderer/components/ft-input/ft-input.js @@ -27,6 +27,10 @@ export default Vue.extend({ type: Boolean, default: false }, + selectOnFocus: { + type: Boolean, + default: false + }, disabled: { type: Boolean, default: false @@ -130,6 +134,13 @@ export default Vue.extend({ handleInputBlur: function () { if (!this.searchState.isPointerInList) { this.searchState.showOptions = false } + }, + + handleFocus: function(e) { + this.searchState.showOptions = true + if (this.selectOnFocus) { + e.target.select() + } } } }) diff --git a/src/renderer/components/ft-input/ft-input.vue b/src/renderer/components/ft-input/ft-input.vue index 1d7224cc..fd6e1f28 100644 --- a/src/renderer/components/ft-input/ft-input.vue +++ b/src/renderer/components/ft-input/ft-input.vue @@ -27,7 +27,7 @@ :placeholder="placeholder" :disabled="disabled" @input="e => handleInput(e.target.value)" - @focus="searchState.showOptions = true" + @focus="handleFocus" @blur="handleInputBlur" @keydown="e => handleKeyDown(e.keyCode)" > diff --git a/src/renderer/components/top-nav/top-nav.vue b/src/renderer/components/top-nav/top-nav.vue index 96f638e1..c5d20170 100644 --- a/src/renderer/components/top-nav/top-nav.vue +++ b/src/renderer/components/top-nav/top-nav.vue @@ -44,6 +44,7 @@ :placeholder="$t('Search / Go to URL')" class="searchInput" :is-search="true" + :select-on-focus="true" :data-list="searchSuggestionsDataList" @input="getSearchSuggestionsDebounce" @click="goToSearch" diff --git a/src/renderer/views/Channel/Channel.vue b/src/renderer/views/Channel/Channel.vue index a222bae3..b56831d5 100644 --- a/src/renderer/views/Channel/Channel.vue +++ b/src/renderer/views/Channel/Channel.vue @@ -70,6 +70,7 @@