Skip to content

fix(react-headless-components-preview): default aria-hidden on NavCategoryItem's expandIcon slot - #36690

Open
Ray Knight (ArrayKnight) wants to merge 1 commit into
microsoft:masterfrom
ArrayKnight:fix/headless-nav-category-item-aria-hidden-36685
Open

fix(react-headless-components-preview): default aria-hidden on NavCategoryItem's expandIcon slot#36690
Ray Knight (ArrayKnight) wants to merge 1 commit into
microsoft:masterfrom
ArrayKnight:fix/headless-nav-category-item-aria-hidden-36685

Conversation

@ArrayKnight

Copy link
Copy Markdown
Contributor

Griffel's @fluentui/react-nav marks the decorative expand chevron aria-hidden: true by default on both useNavCategoryItem_unstable and useNavCategoryItemBase_unstable. The headless useNavCategoryItem re-implements the expandIcon slot with slot.optional (no default glyph, unlike the base hook's slot.always) but dropped that aria-hidden default in the process. As a result, any expandIcon a 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.always spreads {...defaultProps, ...props}, so a consumer passing expandIcon={{ 'aria-hidden': false, ... }} still wins.

Fixes #36685.

Extracted from #36656 — each in-tree fix from that PR as an isolated change.

…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.
@ArrayKnight
Ray Knight (ArrayKnight) requested a review from a team as a code owner September 3, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: headless NavCategoryItem drops the aria-hidden default on its expandIcon slot, so a custom chevron leaks into the button's accessible name

1 participant