-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
Describe the bug
A button toolbar with keynav enabled is a keyboard trap. Once the toolbar is focused, you can only leave it with TAB, SHIFT + TAB does not work anymore
Steps to reproduce the bug
- Give focus to the toolbar
- Press SHIFT+Tab
- The focus is blocked on the toolbar.
Expected behavior
SHFT + Tab should give focus to the first focusable element before the toolbar in dom (or in the tab-index order)
Versions
Libraries:
- BootstrapVue: 2.16.0
Environment:
- Browser: Tested with Chrone and Firefox
Demo link
It can be reproduce on the online documentation , example 1 :
https://bootstrap-vue.org/docs/components/button-toolbar
Analyze
The root element of the button-toolbar has a tabindex of 0, onFocusIn sets the focus on the toolbar's first child.
Therefore, when the focus is active on any child element of the button-toolbar:
- SHIFT+TAB is pressed
- the focus is given to the first previous focusable element, which is the root element of the button toolbar.
- onFocusIn is triggered
- the focus is returned to the child element of the first button-toolbar