Make keys work as intended when there is no suggestions

This commit is contained in:
tusooa 2023-01-21 14:50:57 -05:00
parent 246593970b
commit 5478192e20
No known key found for this signature in database
GPG Key ID: 7B467EDE43A08224
1 changed files with 6 additions and 2 deletions

View File

@ -395,7 +395,9 @@ const EmojiInput = {
} else if (this.highlighted < -1) { } else if (this.highlighted < -1) {
this.highlighted = len - 1 this.highlighted = len - 1
} }
e.preventDefault() if (len > 0) {
e.preventDefault()
}
}, },
cycleForward (e) { cycleForward (e) {
const len = this.suggestions.length || 0 const len = this.suggestions.length || 0
@ -405,7 +407,9 @@ const EmojiInput = {
this.highlighted = -1 this.highlighted = -1
this.input.focus() this.input.focus()
} }
e.preventDefault() if (len > 0) {
e.preventDefault()
}
}, },
scrollIntoView () { scrollIntoView () {
const rootRef = this.$refs.picker.$el const rootRef = this.$refs.picker.$el