From b376a3d80d3ce7a9106bf42b890167ecc992f912 Mon Sep 17 00:00:00 2001 From: Siju Samson Date: Thu, 4 Feb 2021 01:33:21 +0530 Subject: Fix dropdown keys to open menu (#32750) Co-authored-by: XhmikosR --- js/src/dropdown.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/src') 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 -- cgit v1.2.3