Attempt to return focus explicitly to dropdown trigger (#41365)

Co-authored-by: Mark Otto <mdo@heypierre.app>
This commit is contained in:
Mark Otto 2025-04-21 21:20:09 -07:00 committed by GitHub
parent 1d441c7c7f
commit 24305e7b18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -207,6 +207,9 @@ class Dropdown extends BaseComponent {
this._element.setAttribute('aria-expanded', 'false')
Manipulator.removeDataAttribute(this._menu, 'popper')
EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget)
// Explicitly return focus to the trigger element
this._element.focus()
}
_getConfig(config) {