mirror of
https://github.com/twbs/bootstrap.git
synced 2025-04-09 01:53:53 +02:00
Dropdown — Don't use event delegation
This commit is contained in:
parent
b2bc159d72
commit
5f946d3a86
@ -192,7 +192,7 @@ class Dropdown extends BaseComponent {
|
|||||||
if ('ontouchstart' in document.documentElement &&
|
if ('ontouchstart' in document.documentElement &&
|
||||||
!parent.closest(SELECTOR_NAVBAR_NAV)) {
|
!parent.closest(SELECTOR_NAVBAR_NAV)) {
|
||||||
[].concat(...document.body.children)
|
[].concat(...document.body.children)
|
||||||
.forEach(elem => EventHandler.on(elem, 'mouseover', null, noop))
|
.forEach(elem => EventHandler.on(elem, 'mouseover', noop))
|
||||||
}
|
}
|
||||||
|
|
||||||
this._element.focus()
|
this._element.focus()
|
||||||
@ -222,7 +222,7 @@ class Dropdown extends BaseComponent {
|
|||||||
// empty mouseover listeners we added for iOS support
|
// empty mouseover listeners we added for iOS support
|
||||||
if ('ontouchstart' in document.documentElement) {
|
if ('ontouchstart' in document.documentElement) {
|
||||||
[].concat(...document.body.children)
|
[].concat(...document.body.children)
|
||||||
.forEach(elem => EventHandler.off(elem, 'mouseover', null, noop))
|
.forEach(elem => EventHandler.off(elem, 'mouseover', noop))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._popper) {
|
if (this._popper) {
|
||||||
@ -435,7 +435,7 @@ class Dropdown extends BaseComponent {
|
|||||||
// empty mouseover listeners we added for iOS support
|
// empty mouseover listeners we added for iOS support
|
||||||
if ('ontouchstart' in document.documentElement) {
|
if ('ontouchstart' in document.documentElement) {
|
||||||
[].concat(...document.body.children)
|
[].concat(...document.body.children)
|
||||||
.forEach(elem => EventHandler.off(elem, 'mouseover', null, noop))
|
.forEach(elem => EventHandler.off(elem, 'mouseover', noop))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context._popper) {
|
if (context._popper) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user