2
0
mirror of https://github.com/frappe/books.git synced 2025-01-23 15:18:24 +00:00

refactor: search bar vo vue3, remove 'x'

This commit is contained in:
18alantom 2022-02-11 11:25:07 +05:30
parent fb525c88b3
commit 3d9344a0ed

View File

@ -22,9 +22,13 @@
autocomplete="off"
spellcheck="false"
v-model="inputValue"
@input="search"
@input="
() => {
search();
toggleDropdown(true);
}
"
ref="input"
@focus="$toggleDropdown = toggleDropdown"
@keydown.up="highlightItemUp"
@keydown.down="highlightItemDown"
@keydown.enter="selectHighlightedItem"
@ -48,7 +52,6 @@ export default {
inputValue: '',
searchList: [],
suggestions: [],
$toggleDropdown: null,
};
},
components: {
@ -60,8 +63,6 @@ export default {
},
methods: {
async search() {
this.$toggleDropdown && this.$toggleDropdown(true);
this.suggestions = this.searchList.filter((d) => {
let key = this.inputValue.toLowerCase();
return d.label.toLowerCase().includes(key);
@ -124,3 +125,11 @@ export default {
},
};
</script>
<style scoped>
input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-results-button,
input[type='search']::-webkit-search-results-decoration {
display: none;
}
</style>