diff options
| author | Siju Samson <[email protected]> | 2021-02-04 01:33:21 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-03 22:03:21 +0200 |
| commit | b376a3d80d3ce7a9106bf42b890167ecc992f912 (patch) | |
| tree | 8cd16f05fd2c33a955f9c1298fdbfb9d6237d42f /js/src | |
| parent | 2a9d72133d52af1ca72944f1d19474957b54d618 (diff) | |
| download | bootstrap-b376a3d80d3ce7a9106bf42b890167ecc992f912.tar.xz bootstrap-b376a3d80d3ce7a9106bf42b890167ecc992f912.zip | |
Fix dropdown keys to open menu (#32750)
Co-authored-by: XhmikosR <[email protected]>
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/dropdown.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 69b99e628..3667fa111 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -468,6 +468,12 @@ class Dropdown extends BaseComponent { return } + if (!isActive && (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY)) { + const button = this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0] + button.click() + return + } + if (!isActive || event.key === SPACE_KEY) { Dropdown.clearMenus() return |
