fix(react-headless-components-preview): default aria-hidden on NavCategoryItem's expandIcon slot - #36690
Open
Ray Knight (ArrayKnight) wants to merge 1 commit into
Conversation
…egoryItem's expandIcon slot The Griffel react-nav hooks default the decorative expand chevron to aria-hidden: true; the headless NavCategoryItem re-implements the slot without that default, so any expandIcon a consumer supplies (other than an untitled Fluent icon, which self-hides) leaks into the button's accessible name. Fixes microsoft#36685.
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.
Griffel's
@fluentui/react-navmarks the decorative expand chevronaria-hidden: trueby default on bothuseNavCategoryItem_unstableanduseNavCategoryItemBase_unstable. The headlessuseNavCategoryItemre-implements theexpandIconslot withslot.optional(no default glyph, unlike the base hook'sslot.always) but dropped thataria-hiddendefault in the process. As a result, anyexpandIcona consumer supplies (other than an untitled Fluent icon, which self-hides via@fluentui/react-icons) leaks into the button's accessible name.This restores
defaultProps: { 'aria-hidden': true }on the slot, matching the base hook. It remains overridable:slot.alwaysspreads{...defaultProps, ...props}, so a consumer passingexpandIcon={{ 'aria-hidden': false, ... }}still wins.Fixes #36685.
Extracted from #36656 — each in-tree fix from that PR as an isolated change.