2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00

fix: handle non inited searcher

This commit is contained in:
18alantom 2022-08-23 16:59:30 +05:30
parent 38505c2a4c
commit 2c1c4aedf8

View File

@ -287,7 +287,7 @@ export default {
},
open() {
this.openModal = true;
this.searcher.updateKeywords();
this.searcher?.updateKeywords();
nextTick(() => {
this.$refs.input.focus();
});
@ -370,6 +370,10 @@ export default {
}, {});
},
suggestions() {
if (!this.searcher) {
return [];
}
const suggestions = this.searcher.search(this.inputValue);
if (this.limit === -1) {
return suggestions;