diff --git a/platypush/backend/http/webapp/src/components/elements/Autocomplete.vue b/platypush/backend/http/webapp/src/components/elements/Autocomplete.vue index d63dc11551..5d49a8b444 100644 --- a/platypush/backend/http/webapp/src/components/elements/Autocomplete.vue +++ b/platypush/backend/http/webapp/src/components/elements/Autocomplete.vue @@ -25,8 +25,8 @@ v-for="(item, i) in visibleItems" @click="onItemSelect(item)" > - {{ item.substr(0, value.length) }} - {{ item.substr(value.length) }} + {{ item.substr(0, value.length) }} + {{ item.substr(value?.length || 0) }} @@ -80,6 +80,9 @@ export default { computed: { visibleItems() { + if (!this.value?.length) + return this.items + const val = this.value.toUpperCase() if (!val?.length) return this.showResultsWhenBlank ? this.items : [] @@ -125,6 +128,9 @@ export default { }, valueIsInItems() { + if (!this.value) + return false + return this.items.indexOf(this.value) >= 0 },