Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Attempt to return focus explicitly to dropdown trigger
  • Loading branch information
Mark Otto committed Apr 10, 2025
commit 367fa135aa637f64c6f22f6b7e5e592a0f53633f
3 changes: 3 additions & 0 deletions js/src/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down