Skip to content

Commit

Permalink
Fix bookmark search results when search suggestions are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
kommunarr committed Apr 23, 2024
1 parent 0572d33 commit 88ec2a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/renderer/components/ft-input/ft-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 8 additions & 5 deletions src/renderer/components/top-nav/top-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
},

Expand Down

0 comments on commit 88ec2a8

Please sign in to comment.