From: Mark Otto Date: Tue, 22 Apr 2025 04:20:09 +0000 (-0700) Subject: Attempt to return focus explicitly to dropdown trigger (#41365) X-Git-Tag: v5.3.6~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24305e7b187875c524a3c9c97ae53e47c1cc5b03;p=thirdparty%2Fbootstrap.git Attempt to return focus explicitly to dropdown trigger (#41365) Co-authored-by: Mark Otto --- diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 96094a3e65..88af932f76 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -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) {