diff --git a/src/content-scripts/renderer/popup/tag-book/index.vue b/src/content-scripts/renderer/popup/tag-book/index.vue index b89af72..b5102a9 100644 --- a/src/content-scripts/renderer/popup/tag-book/index.vue +++ b/src/content-scripts/renderer/popup/tag-book/index.vue @@ -91,6 +91,7 @@ export default { ); const handleClickOutside = () => { ctx.emit("close"); + mitt.emit('tag-search-clear'); }; const storage: Storage = inject("storage", { diff --git a/src/content-scripts/renderer/popup/tag-book/tag-searcher.vue b/src/content-scripts/renderer/popup/tag-book/tag-searcher.vue index 949ea1f..ac577fa 100644 --- a/src/content-scripts/renderer/popup/tag-book/tag-searcher.vue +++ b/src/content-scripts/renderer/popup/tag-book/tag-searcher.vue @@ -36,6 +36,9 @@ export default { } ); const taginput = ref(null); + mitt.on('tag-search-clear', () => { + searchText.value = ""; + }) mitt.on('tag-search-focus', () => { (taginput.value as unknown as HTMLElement)?.focus(); })