You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also, tested it with NVDA screen-reader and nothing is announced wrongly atleast to me.
Used aria-hidden even though it is visually hidden, because it doesn't have the following styles as mentioned in the docs:
`aria-hidden="true"` should not be added when:
- The HTML `hidden` attribute is present
- The element or the element's ancestor is hidden with `display: none`- The element or the element's ancestor is hidden with `visibility: hidden`
This PR updates FloatingPortal to add aria-hidden on the visually-hidden helper <span aria-owns=...> that’s rendered when focus guards are enabled. The goal is to keep the aria-owns relationship for accessibility tooling while preventing the helper element from being exposed to assistive tech and from triggering aria-required-children violations in consumers (e.g., Menubar structure checks).
Confidence Score: 4/5
Mostly safe to merge once the aria-hidden attribute is fixed to a valid value.
The change is small and localized, but the current JSX aria-hidden boolean renders an invalid ARIA value (aria-hidden=""), which should be corrected to an explicit string to ensure consistent accessibility behavior.
The reason will be displayed to describe this comment to others. Learn more.
This breaks the aria-owns association entirely and makes the element pointless. To give context, the element is necessary to preserve order when navigating between a trigger and its portaled popup using a virtual cursor (e.g. ctrl + option + left/right arrow with VoiceOver on Mac)
This breaks the aria-owns association entirely and makes the element pointless. To give context, the element is necessary to preserve order when navigating between a trigger and its portaled popup using a virtual cursor (e.g. ctrl + option + left/right arrow with VoiceOver on Mac)
I thought so.. Then what do you propose to fix the ARIA error mentioned in the related issue? Or perhaps we should ignore it?
Yeah I think it might be a "false positive", as it should also be erroring for the visually-hidden focus guards if any non-menuitem element isn't allowed.
Yeah I think it might be a "false positive", as it should also be erroring for the visually-hidden focus guards if any non-menuitem element isn't allowed.
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
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.
Closes #4004
Tested with Lighthouse
Before: https://base-ui.com/react/components/menubar
After: https://deploy-preview-4027--base-ui.netlify.app/react/components/menubar
Also, tested it with NVDA screen-reader and nothing is announced wrongly atleast to me.
Used
aria-hiddeneven though it is visually hidden, because it doesn't have the following styles as mentioned in the docs: