]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Attempt to return focus explicitly to dropdown trigger (#41365)
authorMark Otto <markd.otto@gmail.com>
Tue, 22 Apr 2025 04:20:09 +0000 (21:20 -0700)
committerGitHub <noreply@github.com>
Tue, 22 Apr 2025 04:20:09 +0000 (21:20 -0700)
Co-authored-by: Mark Otto <mdo@heypierre.app>
js/src/dropdown.js

index 96094a3e6577ef5166862edd1e9c542e7550a62e..88af932f76cbcfb39d698bc09a6cff22c311c33d 100644 (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) {