Add check for active suggestion (#1180)
This commit is contained in:
@@ -161,10 +161,15 @@ export default {
|
|||||||
break
|
break
|
||||||
|
|
||||||
case "Tab":
|
case "Tab":
|
||||||
event.preventDefault()
|
|
||||||
let activeSuggestion = this.suggestions[
|
let activeSuggestion = this.suggestions[
|
||||||
this.currentSuggestionIndex >= 0 ? this.currentSuggestionIndex : 0
|
this.currentSuggestionIndex >= 0 ? this.currentSuggestionIndex : 0
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (!activeSuggestion) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault()
|
||||||
let input = this.text.substring(0, this.selectionStart)
|
let input = this.text.substring(0, this.selectionStart)
|
||||||
this.text = input + activeSuggestion
|
this.text = input + activeSuggestion
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user