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

"ushindi bienvenu \(@usbbush\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69d162729916a_3b1915b8656f2@gitlab-sidekiq-low-urgency-cpu-bound-v2-664f654ff4-25rst.mail>

ushindi bienvenu pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
bc18d714 by Moïse Nturubika at 2026-04-04T19:04:12+00:00
[BP][FIX] Correct popover hover interaction and visibility issue
---
* [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

See merge request tikiwiki/tiki!9904

- - - - -


1 changed file:

- lib/jquery_tiki/tiki-jquery.js


Changes:

=====================================
lib/jquery_tiki/tiki-jquery.js
=====================================
@@ -502,26 +502,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/bc18d714a0a10393bdae5e260bcdcc6e4a00f7e7

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/bc18d714a0a10393bdae5e260bcdcc6e4a00f7e7
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.