[toggle-group] Remove invalid aria-orientation from role="group" element#4628
Open
sernstberger wants to merge 1 commit intomui:masterfrom
Open
[toggle-group] Remove invalid aria-orientation from role="group" element#4628sernstberger wants to merge 1 commit intomui:masterfrom
sernstberger wants to merge 1 commit intomui:masterfrom
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,316.22 ms 🔺+63.31 ms(+5.1%) | Renders: 53 (+0) | Paint: 2,070.44 ms 🔺+116.04 ms(+5.9%)
...and 7 more. View full report Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
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
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