Remove unnecessary tabIndex from gantt chart SVG rect elements for improved accessibility #41029
Merged
Conversation
Skn0tt
approved these changes
May 28, 2026
Contributor
Author
|
Thanks for reviewing and for the clarification around the WCAG tradeoff. Glad the change aligns better with the expected keyboard accessibility behavior! |
Contributor
Test results for "MCP"7207 passed, 1113 skipped Merge workflow run. |
Contributor
Test results for "tests 1"2 flaky43944 passed, 864 skipped Merge workflow run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes the tabIndex={0} attribute from gantt chart bar elements that lack corresponding keyboard event handlers, fixing an accessibility anti-pattern that violates WCAG 2.1 guidelines.
Problem
The gantt chart in the HTML reporter renders SVG elements with tabIndex={0}, making them appear focusable and interactive to keyboard and screen reader users. However, these elements have no keyboard event handlers, creating a confusing and broken user experience:
Keyboard users tab onto gantt bars but can't interact with them
Screen readers announce bars as focusable when they're not interactive
Users waste keyboard navigation effort.
Solution
Remove tabIndex={0} from gantt bar elements since they are purely visual timeline indicators with no interactive purpose. The <title> element already provides tooltip accessibility.
Changes Made
File: packages/html-reporter/src/gantt.tsx
Change: Removed tabIndex={0} from SVG rect element (line 157).
fixes #41027
@pavelfeldman kindly consider this tiny minor change