]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Tweak iOS hack for dropdown
authorPatrick H. Lauke <redux@splintered.co.uk>
Thu, 20 Apr 2017 13:08:40 +0000 (14:08 +0100)
committerGitHub <noreply@github.com>
Thu, 20 Apr 2017 13:08:40 +0000 (14:08 +0100)
Tweak to https://github.com/twbs/bootstrap/pull/22426, where the wrong selector slipped through the net (selecting all of `<body>`s grand-children rather than children)

js/src/dropdown.js

index 812e718a88a18d8eac2cb2b9bce58ec874106760..eb536dc7dc34ab18788b65f1315be9d7a9b45ed6 100644 (file)
@@ -111,7 +111,7 @@ const Dropdown = (($) => {
       // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
       if ('ontouchstart' in document.documentElement &&
          !$(parent).closest(Selector.NAVBAR_NAV).length) {
-        $('body').children().on('mouseover', '*', $.noop)
+        $('body').children().on('mouseover', null, $.noop)
       }
 
       this.focus()
@@ -190,7 +190,7 @@ const Dropdown = (($) => {
         // if this is a touch-enabled device we remove the extra
         // empty mouseover listeners we added for iOS support
         if ('ontouchstart' in document.documentElement) {
-          $('body').children().off('mouseover', '*', $.noop)
+          $('body').children().off('mouseover', null, $.noop)
         }
 
         toggles[i].setAttribute('aria-expanded', 'false')