You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Move focus to previous control (Keyboard navigation, SHIFT - TAB) #6424
I'm the author of Dueuno (https://dueuno.com), an Open Source framework built on top of Apache Grails we use to build business applications. We have been using Select2 for some time now and we are required to implement keyboard navigation on the applications we develop with the framewrok.
I've tryied to fix the below issue with no luck: - Pressing SHIFT + TAB does not move the focus to the previous control.
We are using the Bootstrap template, in case it makes any difference.
Any help would be appreciated.
changed the title [-]Select previous control (Keyboard navigation, SHIFT - TAB)[/-][+]Move focus to previous control (Keyboard navigation, SHIFT - TAB)[/+]on Jul 28, 2026
I reproduced this with the default Select2 theme, so Bootstrap is not required for the open-dropdown case.
In the current keyboard handler, when the dropdown is open, both Enter and Tab trigger results:select and call preventDefault(). That branch does not check shiftKey, so Shift+Tab selects the highlighted result instead of performing the browser's backward focus navigation.
Chromium checks with an input before and after the Select2 control:
Sequence
Single select
Multiple select
Closed dropdown, Shift+Tab
Previous input receives focus
Previous input receives focus
Open dropdown, Shift+Tab
Dropdown closes; focus remains on Select2
Highlighted Alpha is selected; focus remains on Select2
Open dropdown, Escape, then Shift+Tab
Previous input receives focus
Previous input receives focus, no option added
Escape followed by Shift+Tab is therefore a working keyboard route with the tested default behavior. It is not equivalent to fixing one-keystroke backward navigation. A library change should explicitly decide whether Shift+Tab should close without committing a result and allow native focus movement, while preserving the intended unmodified Tab behavior.
Does your failure occur only while the dropdown is open, or also when it is closed? I tested single/multiple controls with the current bundle and default theme, not Dueuno's Bootstrap integration.
Activity
[-]Select previous control (Keyboard navigation, SHIFT - TAB)[/-][+]Move focus to previous control (Keyboard navigation, SHIFT - TAB)[/+]sridharkalaibala commentedon Sep 13, 2026
I reproduced this with the default Select2 theme, so Bootstrap is not required for the open-dropdown case.
In the current keyboard handler, when the dropdown is open, both Enter and Tab trigger
results:selectand callpreventDefault(). That branch does not checkshiftKey, so Shift+Tab selects the highlighted result instead of performing the browser's backward focus navigation.Chromium checks with an input before and after the Select2 control:
Escape followed by Shift+Tab is therefore a working keyboard route with the tested default behavior. It is not equivalent to fixing one-keystroke backward navigation. A library change should explicitly decide whether Shift+Tab should close without committing a result and allow native focus movement, while preserving the intended unmodified Tab behavior.
Does your failure occur only while the dropdown is open, or also when it is closed? I tested single/multiple controls with the current bundle and default theme, not Dueuno's Bootstrap integration.