Skip to content

Commit

Permalink
Dropdown — Don't use event delegation
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit2sharma95 authored and XhmikosR committed Apr 11, 2021
1 parent b2bc159 commit 5f946d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/src/dropdown.js
Expand Up @@ -192,7 +192,7 @@ class Dropdown extends BaseComponent {
if ('ontouchstart' in document.documentElement &&
!parent.closest(SELECTOR_NAVBAR_NAV)) {
[].concat(...document.body.children)
.forEach(elem => EventHandler.on(elem, 'mouseover', null, noop))
.forEach(elem => EventHandler.on(elem, 'mouseover', noop))
}

this._element.focus()
Expand Down Expand Up @@ -222,7 +222,7 @@ class Dropdown extends BaseComponent {
// empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) {
[].concat(...document.body.children)
.forEach(elem => EventHandler.off(elem, 'mouseover', null, noop))
.forEach(elem => EventHandler.off(elem, 'mouseover', noop))
}

if (this._popper) {
Expand Down Expand Up @@ -435,7 +435,7 @@ class Dropdown extends BaseComponent {
// empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) {
[].concat(...document.body.children)
.forEach(elem => EventHandler.off(elem, 'mouseover', null, noop))
.forEach(elem => EventHandler.off(elem, 'mouseover', noop))
}

if (context._popper) {
Expand Down

0 comments on commit 5f946d3

Please sign in to comment.