twbs / twbs/bootstrap

Keyboard navigation for Tabs and Tab Dropdown Menues

Open
#41,630 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accessibility
Dominant language
MDX
Stars
175k
Forks
78.6k
Avg merge
7h 19m
Merged PRs (30d)
35

Description

Prerequisites
Describe the issue

I am experiencing a possible accessibility issue involving keyboard navigation when using Tabs combined with Tab menus. When a tab has focus the roving tab index sets the other tabs to have tabindex="-1" so that they are skipped when pressing Tab. However, this does not happen for Tab Menus, and pressing Tab while on a Tab will skip from the current Tab to the Tab Menu, and Shift+Tab will move back to the last focused tab. Left and Right arrow keys successfully navigate between Tabs, but once a Tab Menu is focused, arrow keys do not seem to allow one to navigate back to Tabs. Meanwhile if one has multiple tab menus, arrow keys do not navigate between them and one must use Tab or Shift+Tab to navigate between tab menus. This inconsistent keyboard navigation, and conflicting when using them in combination, seems like an accessibility issue.

Reduced test cases

https://codepen.io/sboeck/pen/empgbJe

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Microsoft Edge

What version of Bootstrap are you using?

5.3.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reduced test case at CodePen and reproduce the keyboard behavior in Bootstrap 5.3.3 on the reported setup. Compare navigation among tabs and tab menus, including multiple menus and reverse navigation. Done means the combined controls have consistent, accessible keyboard movement without the reported focus skips.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.