From f446c9acc10e0412517942c166a0d30945ffa622 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Wed, 11 Dec 2019 17:28:32 -0500 Subject: [PATCH] Generalized AutoComplete Component code --- components/autocomplete.vue | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/components/autocomplete.vue b/components/autocomplete.vue index eb46239bd..32d39a422 100644 --- a/components/autocomplete.vue +++ b/components/autocomplete.vue @@ -3,7 +3,7 @@ = 0 ? this.currentSuggestionIndex : 0 ]; if (activeSuggestion) { - let input = this.value.substring(0, this.selectionStart); - this.value = input + activeSuggestion; + let input = this.text.substring(0, this.selectionStart); + this.text = input + activeSuggestion; } break; @@ -184,7 +190,7 @@ export default { * @returns {default.props.source|{type, required}} */ suggestions() { - let input = this.value.substring(0, this.selectionStart); + let input = this.text.substring(0, this.selectionStart); return ( this.source