From 24305e7b187875c524a3c9c97ae53e47c1cc5b03 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 21 Apr 2025 21:20:09 -0700 Subject: [PATCH] Attempt to return focus explicitly to dropdown trigger (#41365) Co-authored-by: Mark Otto --- js/src/dropdown.js | 3 +++ 1 file changed, 3 insertions(+) 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) {