Description
Do the tabindex trick before checking whether the element has the role="tab"
or not.
Motivation & Context
I couldn't spot any breaking change.
I tried to change the role
of the tab component to make it a menubar
but I went into the following issue following those steps:
- Click on the active tab
-
Tab
andShift + Tab
works well 🟢 -
→
,Tab
andShift + Tab
works but not as expected 🟡 -
→
,→
,Tab
andShift + Tab
doesn't work at all🔴
Is there a need for role="tablist/tab"
to make it work/accessible ? If yes, why the behavior still works if I stay on the tabs element ?
Here is the Codepen I used to make some tests:
https://codepen.io/louismaximepiton/pen/oNqOEWG
Type of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Refactoring (non-breaking change) -
Breaking change (fix or feature that would change existing functionality)
Checklist
-
I have read the contributing guidelines -
My code follows the code style of the project (using npm run lint
) -
My change introduces changes to the documentation -
I have updated the documentation accordingly -
I have added tests to cover my changes -
All new and existing tests passed
Live previews
Related issues
Might be linked to #33079.