]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
docs: improve description of #11410 bug fix in dropdownMenu
authorNicolas Coden <nicolas@ncoden.fr>
Thu, 19 Jul 2018 21:15:25 +0000 (23:15 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Thu, 19 Jul 2018 22:14:43 +0000 (00:14 +0200)
js/foundation.dropdownMenu.js

index 7e5b4e160dfd397597f00956bfda1abd121b4c28..354937cbb190f00f36711d7f4a4c31bfccbc8e7b 100644 (file)
@@ -158,8 +158,14 @@ class DropdownMenu extends Plugin {
           clearTimeout($elem.data('_delay'));
           $elem.data('_delay', setTimeout(function () {
 
-            // Check for hovering over input dropdown options
+            // Ignore "magic mouseleave": when the mouse simply disapear from the document
+            // (like when entering in browser input suggestions See https://git.io/zf-11410),
+            // unless we actually leaved the window (and document lost focus).
+            //
+            // In firefox, document will not focus at the time the event is triggered, so we have
+            // to make this test after the delay.
             if (e.relatedTarget === null && document.hasFocus && document.hasFocus()) { return false; }
+
             _this._hide($elem);
 
           }, _this.options.closingTime));