🌐 AI搜索 & 代理 主页
Skip to content

Button Toolbar : When keynav is enabled, SHIFT + Tab cannot work #5733

@mehdirande

Description

@mehdirande

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

  1. Give focus to the toolbar
  2. Press SHIFT+Tab
  3. 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions