diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-12-24 12:34:24 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-12-24 12:34:24 +0900 |
| commit | b4636631751449da34e2bad7e7276546c6fd3967 (patch) | |
| tree | 10c93c4d3b3809a3ca1a9baf4484b838bfca5d84 /packages/client/src/scripts/use-tooltip.ts | |
| parent | fix(client): fix zindex issue (diff) | |
| download | sharkey-b4636631751449da34e2bad7e7276546c6fd3967.tar.gz sharkey-b4636631751449da34e2bad7e7276546c6fd3967.tar.bz2 sharkey-b4636631751449da34e2bad7e7276546c6fd3967.zip | |
enhance(client): tweak ui
Diffstat (limited to 'packages/client/src/scripts/use-tooltip.ts')
| -rw-r--r-- | packages/client/src/scripts/use-tooltip.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/client/src/scripts/use-tooltip.ts b/packages/client/src/scripts/use-tooltip.ts index d0c6756eb1..bc8f27a038 100644 --- a/packages/client/src/scripts/use-tooltip.ts +++ b/packages/client/src/scripts/use-tooltip.ts @@ -1,4 +1,4 @@ -import { Ref, ref, watch } from 'vue'; +import { Ref, ref, watch, onUnmounted } from 'vue'; export function useTooltip( elRef: Ref<HTMLElement | { $el: HTMLElement } | null | undefined>, @@ -72,9 +72,14 @@ export function useTooltip( el.addEventListener('mouseleave', onMouseleave, { passive: true }); el.addEventListener('touchstart', onTouchstart, { passive: true }); el.addEventListener('touchend', onTouchend, { passive: true }); + el.addEventListener('click', close, { passive: true }); } }, { immediate: true, flush: 'post', }); + + onUnmounted(() => { + close(); + }); } |