]> source.dussan.org Git - gitea.git/commitdiff
Only hide tooltip tippy instances (#24688)
authorsilverwind <me@silverwind.io>
Fri, 12 May 2023 16:58:55 +0000 (18:58 +0200)
committerGitHub <noreply@github.com>
Fri, 12 May 2023 16:58:55 +0000 (16:58 +0000)
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

index 3a8c7e09c26b9b12fa2a41eb7800a6b7d707e205..abae3d33d07d0ad0c981bf978e19db30dd372683 100644 (file)
@@ -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);
     },