Add check for active suggestion (#1180)
This commit is contained in:
parent
db081d3197
commit
45fb612793
1 changed files with 6 additions and 1 deletions
|
|
@ -161,10 +161,15 @@ export default {
|
|||
break
|
||||
|
||||
case "Tab":
|
||||
event.preventDefault()
|
||||
let activeSuggestion = this.suggestions[
|
||||
this.currentSuggestionIndex >= 0 ? this.currentSuggestionIndex : 0
|
||||
]
|
||||
|
||||
if (!activeSuggestion) {
|
||||
return
|
||||
}
|
||||
|
||||
event.preventDefault()
|
||||
let input = this.text.substring(0, this.selectionStart)
|
||||
this.text = input + activeSuggestion
|
||||
break
|
||||
|
|
|
|||
Loading…
Reference in a new issue