]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: move relatedTarget null check to setTimeout for #11410
authorArlo Duff <arlo.duff@shoes.com>
Thu, 19 Jul 2018 14:43:01 +0000 (10:43 -0400)
committerArlo Duff <arlo.duff@shoes.com>
Thu, 19 Jul 2018 14:43:01 +0000 (10:43 -0400)
js/foundation.dropdownMenu.js

index b2dc0d48a6fa57babf149294120562ab2df05c4a..042716fb5876e163d94c6a1c47037923d96640ac 100644 (file)
@@ -154,13 +154,13 @@ class DropdownMenu extends Plugin {
             hasSub = $elem.hasClass(parClass);
         if (hasSub && _this.options.autoclose) {
           if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) { return false; }
-          // Check for hovering over input dropdown options
-          if(e.relatedTarget === null && document.hasFocus && document.hasFocus()) {
-            return false;
-          }
 
           clearTimeout($elem.data('_delay'));
           $elem.data('_delay', setTimeout(function() {
+            // Check for hovering over input dropdown options
+            if(e.relatedTarget === null && document.hasFocus && document.hasFocus()) {
+              return false;
+            }
             _this._hide($elem);
           }, _this.options.closingTime));
         }