diff --git a/src/renderer/components/ft-input/ft-input.js b/src/renderer/components/ft-input/ft-input.js index dce55137c..1e6c48698 100644 --- a/src/renderer/components/ft-input/ft-input.js +++ b/src/renderer/components/ft-input/ft-input.js @@ -303,7 +303,6 @@ export default defineComponent({ }, updateVisibleDataList: function () { - if (this.dataList.length === 0) { return } // Reset selected option before it's updated this.searchState.selectedOption = -1 this.searchState.keyboardSelectedOptionIndex = -1 diff --git a/src/renderer/components/top-nav/top-nav.js b/src/renderer/components/top-nav/top-nav.js index 9dc4a820c..b3b4833ec 100644 --- a/src/renderer/components/top-nav/top-nav.js +++ b/src/renderer/components/top-nav/top-nav.js @@ -271,12 +271,15 @@ export default defineComponent({ }, getSearchSuggestionsDebounce: function (query) { + const trimmedQuery = query.trim() + if (trimmedQuery === this.lastSuggestionQuery) { + return + } + + this.lastSuggestionQuery = trimmedQuery + if (this.enableSearchSuggestions) { - const trimmedQuery = query.trim() - if (trimmedQuery !== this.lastSuggestionQuery) { - this.lastSuggestionQuery = trimmedQuery - this.debounceSearchResults(trimmedQuery) - } + this.debounceSearchResults(trimmedQuery) } },