Skip to content

Commit e912d35

Browse files
committed
fix tippy bug
1 parent c208669 commit e912d35

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

web_src/js/features/common-global.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ export function initGlobalCommon() {
104104
},
105105
onHide() {
106106
this._tippy?.enable();
107+
108+
// hide all tippy elements of items after a while. eg: keyboard Enter to trigger the "Copy Link" in the Issue Context Menu
109+
setTimeout(() => {
110+
$(this).find('.menu > .item').each((_, item) => {
111+
item._tippy?.hide();
112+
});
113+
}, 2000);
107114
},
108115
});
109116

web_src/js/modules/tippy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ export function showTemporaryTooltip(target, content) {
5252
onHidden: (tippy) => {
5353
if (oldContent) {
5454
tippy.setContent(oldContent);
55+
tippy.setProps({onHidden: undefined});
5556
} else {
5657
tippy.destroy();
58+
// after destroy, the `_tippy` is detached, it can't do "setProps (etc...)" anymore
5759
}
58-
tippy.setProps({onHidden: undefined});
5960
},
6061
});
6162
}

0 commit comments

Comments
 (0)