Skip to content

Commit

Permalink
fix: clear search text when tag-searcher close
Browse files Browse the repository at this point in the history
  • Loading branch information
betterRunner committed Nov 16, 2021
1 parent 64e3806 commit 56b0f2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/content-scripts/renderer/popup/tag-book/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export default {
);
const handleClickOutside = () => {
ctx.emit("close");
mitt.emit('tag-search-clear');
};
const storage: Storage = inject("storage", {
Expand Down
3 changes: 3 additions & 0 deletions src/content-scripts/renderer/popup/tag-book/tag-searcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
})
Expand Down

0 comments on commit 56b0f2b

Please sign in to comment.