From 80bde0141bb4a04b65b399b40ab547bf56c0567e Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 12 May 2023 18:58:55 +0200 Subject: [PATCH] Only hide tooltip tippy instances (#24688) Fix regression from https://github.com/go-gitea/gitea/pull/24648 where it was hiding non-tooltip tippy instances, like for example in the review panel which itself is a tippy instance, but with a different `role`. --- web_src/js/modules/tippy.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web_src/js/modules/tippy.js b/web_src/js/modules/tippy.js index 3a8c7e09c26b..abae3d33d07d 100644 --- a/web_src/js/modules/tippy.js +++ b/web_src/js/modules/tippy.js @@ -18,8 +18,11 @@ export function createTippy(target, opts = {}) { visibleInstances.delete(instance); }, onShow: (instance) => { + // hide other tooltip instances so only one tooltip shows at a time for (const visibleInstance of visibleInstances) { - visibleInstance.hide(); // hide other instances + if (visibleInstance.role === 'tooltip') { + visibleInstance.hide(); + } } visibleInstances.add(instance); },