1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-07 22:26:57 +02:00

Fix dropdown keys to open menu (#32750)

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
Siju Samson
2021-02-04 01:33:21 +05:30
committed by GitHub
parent 2a9d72133d
commit b376a3d80d
2 changed files with 54 additions and 0 deletions

View File

@@ -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