From: silverwind Date: Fri, 12 May 2023 16:58:55 +0000 (+0200) Subject: Only hide tooltip tippy instances (#24688) X-Git-Tag: v1.20.0-rc0~227 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=80bde0141bb4a04b65b399b40ab547bf56c0567e;p=gitea.git 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`. --- diff --git a/web_src/js/modules/tippy.js b/web_src/js/modules/tippy.js index 3a8c7e09c2..abae3d33d0 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); },