Skip to content

Commit 24305e7

Browse files
mdoMark Otto
and
Mark Otto
authored
Attempt to return focus explicitly to dropdown trigger (#41365)
Co-authored-by: Mark Otto <[email protected]>
1 parent 1d441c7 commit 24305e7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

js/src/dropdown.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ class Dropdown extends BaseComponent {
207207
this._element.setAttribute('aria-expanded', 'false')
208208
Manipulator.removeDataAttribute(this._menu, 'popper')
209209
EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget)
210+
211+
// Explicitly return focus to the trigger element
212+
this._element.focus()
210213
}
211214

212215
_getConfig(config) {

0 commit comments

Comments
 (0)