diff options
author | luktom <lksztmczk@gmail.com> | 2020-04-07 21:16:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-07 21:16:17 +0300 |
commit | 8cc9defbc0f236beb02a923b6dd944560fbb1d2c (patch) | |
tree | 57682c284a37b73a97a9d7c14df518f6044e1143 /js/src/dropdown.js | |
parent | 1b575c27cd654a3af82e056af15f7621cbfa6eee (diff) |
Fix event propagation from inactive and disabled dropdowns (#30510) (#30511)
Diffstat (limited to 'js/src/dropdown.js')
-rw-r--r-- | js/src/dropdown.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 12ca85756e..c0f1f6ffe1 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -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) |