Skip to content

Commit

Permalink
fix error when searching (#2960)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkyProgrammer authored Dec 14, 2022
1 parent 29f5e38 commit 083ae0e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/renderer/components/ft-input/ft-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,13 @@ export default Vue.extend({
handleKeyDown: function (event) {
if (this.visibleDataList.length === 0) { return }
if (event.key === 'Enter') {
this.inputData = this.visibleDataList[this.searchState.selectedOption]
// Update Input box value if enter key was pressed and option selected
if (this.searchState.selectedOption !== -1) {
this.searchState.showOptions = false
event.preventDefault()
this.inputData = this.visibleDataList[this.searchState.selectedOption]
this.handleClick()
}
this.handleClick()
} else {
this.searchState.showOptions = true
const isArrow = event.key === 'ArrowDown' || event.key === 'ArrowUp'
Expand Down

0 comments on commit 083ae0e

Please sign in to comment.