Repository navigation
[toggle-group] Remove invalid aria-orientation from role="group" element - #4628
Merged
atomiks merged 3 commits intoJun 8, 2026
Merged
Conversation
sernstberger
requested review from
LukasTy,
atomiks,
colmtuite,
flaviendelangle and
michaldudak
as code owners
April 16, 2026 13:56
commit: |
Bundle size
PerformanceTotal duration: 1,329.47 ms 🔺+274.52 ms(+26.0%) | Renders: 50 (+0) | Paint: 1,997.94 ms 🔺+397.37 ms(+24.8%)
…and 4 more (+3 within noise) — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
mj12albert
reviewed
Apr 16, 2026
| state={state} | ||
| refs={[forwardedRef]} | ||
| props={[defaultProps, elementProps]} | ||
| props={[defaultProps, { 'aria-orientation': undefined }, elementProps]} |
Member
There was a problem hiding this comment.
SelectPopup and NavigationMenuList are already overwriting aria-orientation like this, perhaps it should be moved out of Composite and its consumers should be required to set aria-orientation themselves accordingly
atomiks
approved these changes
Jun 8, 2026
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.
Summary
ToggleGrouprendersrole="group"but was also renderingaria-orientation, which is not a valid ARIA attribute for thegrouprole (WAI-ARIA spec). This was flagged by axe'saria-allowed-attrrule.The
aria-orientationattribute was being added byuseCompositeRoot(which always includes it in its returned props). This was introduced in #4487 when keyboard navigation was added viaCompositeRoot.Fix
Strip
aria-orientationfrom the DOM output by adding{ 'aria-orientation': undefined }to theCompositeRootprops array. This follows the same pattern used byNavigationMenuListandSelectPopupin the codebase.The
orientationprop still reachesCompositeRootfor keyboard navigation — it just won't appear as an ARIA attribute on the rendered element.Test
Added a test asserting that
aria-orientationis not present on therole="group"element.Closes #4623
Related: #4487