0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00

Dropdown — Don't use event delegation

This commit is contained in:
Rohit Sharma 2021-03-27 22:51:08 +05:30 committed by XhmikosR
parent b2bc159d72
commit 5f946d3a86

View File

@ -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()
@ -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) {
@ -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) {