1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-27 13:59:06 +02:00

Fix event propagation from inactive and disabled dropdowns (#30510) (#30511)

This commit is contained in:
luktom
2020-04-07 20:16:17 +02:00
committed by GitHub
parent 1b575c27cd
commit 8cc9defbc0
2 changed files with 67 additions and 3 deletions

View File

@@ -452,9 +452,6 @@ class Dropdown {
return
}
event.preventDefault()
event.stopPropagation()
if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) {
return
}
@@ -466,6 +463,9 @@ class Dropdown {
return
}
event.preventDefault()
event.stopPropagation()
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
if (event.which === ESCAPE_KEYCODE) {
const toggle = parent.querySelector(SELECTOR_DATA_TOGGLE)