1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-10 15:44:51 +02:00

Closing dropdown with ESC correctly sets focus to toggle (#28928)

Just firing the focus event isn't enough ... need to actually call the proper `focus()` method for it to actually do it...
This commit is contained in:
Patrick H. Lauke
2019-06-19 10:23:41 +01:00
committed by XhmikosR
parent ceffc3a5fd
commit f0f75379f6
2 changed files with 40 additions and 1 deletions

View File

@@ -486,7 +486,7 @@ class Dropdown {
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
if (event.which === ESCAPE_KEYCODE) {
EventHandler.trigger(SelectorEngine.findOne(Selector.DATA_TOGGLE, parent), 'focus')
SelectorEngine.findOne(Selector.DATA_TOGGLE, parent).focus()
}
Dropdown._clearMenus()