diff --git a/platypush/backend/http/webapp/src/components/elements/Autocomplete.vue b/platypush/backend/http/webapp/src/components/elements/Autocomplete.vue index 5d49a8b444..71f8605283 100644 --- a/platypush/backend/http/webapp/src/components/elements/Autocomplete.vue +++ b/platypush/backend/http/webapp/src/components/elements/Autocomplete.vue @@ -10,7 +10,7 @@ :value="value" @focus="onFocus" @input="onInput" - @blur="onInput" + @blur="onBlur" @keydown="onInputKeyDown" @keyup="onInputKeyUp" > @@ -23,8 +23,7 @@ :key="item" :data-item="item" v-for="(item, i) in visibleItems" - @click="onItemSelect(item)" - > + @click="onItemSelect(item)"> {{ item.substr(0, value.length) }} {{ item.substr(value?.length || 0) }} @@ -150,6 +149,14 @@ export default { this.visible = true }, + onBlur(e) { + this.onInput(e) + this.$nextTick(() => { + if (this.valueIsInItems()) + this.visible = false + }) + }, + onItemSelect(item) { this.$emit("input", item) this.$nextTick(() => {