summaryrefslogtreecommitdiff
path: root/packages/frontend/src/directives
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-05-15 14:29:35 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-05-15 14:29:35 +0900
commit60f504bbe2dc0ccf2e6cc11e9db1de9f087a2e86 (patch)
tree8527196b501466b7ab334c39bd30407dd1006006 /packages/frontend/src/directives
parentrefactor (diff)
downloadmisskey-60f504bbe2dc0ccf2e6cc11e9db1de9f087a2e86.tar.gz
misskey-60f504bbe2dc0ccf2e6cc11e9db1de9f087a2e86.tar.bz2
misskey-60f504bbe2dc0ccf2e6cc11e9db1de9f087a2e86.zip
fix(frontend): ツールチップが永久にDOMに残ることがある問題を修正
#10805
Diffstat (limited to 'packages/frontend/src/directives')
-rw-r--r--packages/frontend/src/directives/tooltip.ts16
1 files changed, 12 insertions, 4 deletions
diff --git a/packages/frontend/src/directives/tooltip.ts b/packages/frontend/src/directives/tooltip.ts
index 5d13497b5f..373141fa35 100644
--- a/packages/frontend/src/directives/tooltip.ts
+++ b/packages/frontend/src/directives/tooltip.ts
@@ -5,7 +5,7 @@ import { defineAsyncComponent, Directive, ref } from 'vue';
import { isTouchUsing } from '@/scripts/touch';
import { popup, alert } from '@/os';
-const start = isTouchUsing ? 'touchstart' : 'mouseover';
+const start = isTouchUsing ? 'touchstart' : 'mouseenter';
const end = isTouchUsing ? 'touchend' : 'mouseleave';
export default {
@@ -63,16 +63,24 @@ export default {
ev.preventDefault();
});
- el.addEventListener(start, () => {
+ el.addEventListener(start, (ev) => {
window.clearTimeout(self.showTimer);
window.clearTimeout(self.hideTimer);
- self.showTimer = window.setTimeout(self.show, delay);
+ if (delay === 0) {
+ self.show();
+ } else {
+ self.showTimer = window.setTimeout(self.show, delay);
+ }
}, { passive: true });
el.addEventListener(end, () => {
window.clearTimeout(self.showTimer);
window.clearTimeout(self.hideTimer);
- self.hideTimer = window.setTimeout(self.close, delay);
+ if (delay === 0) {
+ self.close();
+ } else {
+ self.hideTimer = window.setTimeout(self.close, delay);
+ }
}, { passive: true });
el.addEventListener('click', () => {