Skip to content

Commit

Permalink
refactor: changed getButton to getToggleButton
Browse files Browse the repository at this point in the history
requested by rohit2sharma95 - #33479 (comment)
  • Loading branch information
alpadev authored and GeoSot committed Mar 30, 2021
1 parent 04022c9 commit 3f658e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/src/dropdown.js
Expand Up @@ -501,16 +501,16 @@ class Dropdown extends BaseComponent {
return
}

const getButton = () => this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0]
const getToggleButton = () => this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0]

if (event.key === ESCAPE_KEY) {
getButton().focus()
getToggleButton().focus()
Dropdown.clearMenus()
return
}

if (!isActive && (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY)) {
getButton().click()
getToggleButton().click()
return
}

Expand Down

0 comments on commit 3f658e5

Please sign in to comment.