aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-06-23 22:45:05 +1000
committerTerry Truong <terry06890@gmail.com>2022-06-23 22:45:05 +1000
commitb77d3f8aa4bfea6f62fc597adf4f36ef13d7e002 (patch)
treebecd8d36863632f79a40e195e6805ee9856789e9 /src
parent976aed16b26e3c1968e338d38d2f4b30f8145a17 (diff)
Fix error upon empty-string search
Diffstat (limited to 'src')
-rw-r--r--src/components/SearchModal.vue7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue
index bb58cbb..d2aa383 100644
--- a/src/components/SearchModal.vue
+++ b/src/components/SearchModal.vue
@@ -57,7 +57,7 @@ export default defineComponent({
},
methods: {
onCloseClick(evt: Event){
- if (evt.target == this.$el || (this.$refs.searchIcon as typeof SearchIcon).$el.contains(evt.target)){
+ if (evt.target == this.$el){
this.$emit('close');
}
},
@@ -70,6 +70,9 @@ export default defineComponent({
}
},
resolveSearch(tolNodeName: string){
+ if (tolNodeName == ''){
+ return;
+ }
// Asks server for nodes in parent-chain, updates tolMap, then emits search event
let url = new URL(window.location.href);
url.pathname = '/data/chain';
@@ -210,7 +213,7 @@ export default defineComponent({
<div v-if="searchHasMoreSuggs" class="bg-white px-1 text-center border">...</div>
</div>
</div>
- <search-icon @click.stop="onEnter" ref="searchIcon"
+ <search-icon @click.stop="onEnter"
class="block w-8 h-8 ml-1 hover:cursor-pointer hover:bg-stone-200" />
</div>
</div>