[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][FIX] Correct popover hover interaction and visibility issue

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69cd1b6fae7bf_3b235f96070198@gitlab-sidekiq-low-urgency-cpu-bound-v2-999554d69-df7qf.mail>

luci pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
212352a1 by Moïse Nturubika at 2026-04-01T13:11:47+00:00
[BP][FIX] Correct popover hover interaction and visibility issue
---
* [FIX] Correct popover hover interaction and visibility issue
---
* [FIX] Correct popover hover interaction and visibility issue

See merge request tikiwiki/tiki!7675

See merge request tikiwiki/tiki!9900

- - - - -


1 changed file:

- lib/jquery_tiki/tiki-jquery.js


Changes:

=====================================
lib/jquery_tiki/tiki-jquery.js
=====================================
@@ -526,26 +526,35 @@ $.fn.tiki_popover = function () {
     });
 
     // only have one popover showing at a time
-    $document.on("show.bs.popover", function ( e ) {
-        var event = e;
+    $document.on("show.bs.popover", function (e) {
+        var $currentTrigger = $(e.target);
+
+        // Hide any existing popovers except for the one being triggered
         $('.popover:visible:not(.tour-tour)').each(function () {
-            if (this.previousElementSibling !== event.target) {
-                $(this).popover('hide');
+            var $popover = $(this);
+            var $trigger = $('[aria-describedby="' + $popover.attr('id') + '"]');
+
+            if ($trigger[0] !== $currentTrigger[0]) {
+                $trigger.popover('hide');
             }
         });
     });
 
-    $document.on("hide.bs.popover", function ( e ) {
-        var $popover = $('.popover:visible:not(.tour-tour)');
+    $document.on("hide.bs.popover", function (e) {
+        var $currentTrigger = $(e.target);
+        var $currentPopover = $('#' + $currentTrigger.attr('aria-describedby'));
+        var isHoveringCurrentPopover = $currentPopover.is(':hover');
+        var isHoveringOtherPopover = $('.popover:hover').not($currentPopover).length > 0;
 
-        // if mouse is over the popover
-        if ($popover.find(":hover").length) {
-            // change the leave event to be when leaving the popover
-            $popover.on("mouseleave", function () {
-                $(this).popover("hide");
-            });
-            // and cancel the hide event
+        if (isHoveringCurrentPopover && !isHoveringOtherPopover) {
             e.preventDefault();
+            e.stopPropagation();
+
+            $currentPopover.one('mouseleave', function() {
+                if (!$currentTrigger.is(':hover')) {
+                    $currentTrigger.popover('hide');
+                }
+            });
             return false;
         }
     });



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/212352a13bd09a2686dff03fa5e20878ebcaa7fd

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/212352a13bd09a2686dff03fa5e20878ebcaa7fd
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.