fix(react-popover): omit role='group' from PopoverSurface when no accessible name is provided#36383
Draft
PaulGMardling wants to merge 5 commits into
Draft
fix(react-popover): omit role='group' from PopoverSurface when no accessible name is provided#36383PaulGMardling wants to merge 5 commits into
PaulGMardling wants to merge 5 commits into
Conversation
…to fix Narrator style group announcement
📊 Bundle size reportUnchanged fixtures
|
|
Pull request demo site: URL |
| @@ -0,0 +1,7 @@ | |||
| { | |||
There was a problem hiding this comment.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/Avatar Converged 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Avatar Converged.badgeMask.normal.chromium.png | 5 | Changed |
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png | 404 | Changed |
vr-tests-react-components/Positioning 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Positioning.Positioning end.chromium.png | 757 | Changed |
| vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png | 135 | Changed |
vr-tests-react-components/ProgressBar converged 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png | 95 | Changed |
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png | 67 | Changed |
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.

Decision needed
The bug's full expected result is that Narrator announces the popover contents on activation, not just stops saying the wrong thing.
The Popover component already has auto-focus logic — it focuses the surface if tabIndex is set, or the first interactive element inside it.
The gap is when a consumer passes non-interactive content with no tabIndex={-1} on the surface: focus never leaves the trigger and Narrator never reads the content so the user is left lost without feedback
The component cannot know what content is passed in, so this cannot be solved at the component level without risking regressions in other scenarios.
The decision needed is:
Do we push consumers to handle this via guidance and documentation, or do we make a component-level change?
This needs input from the code owners before the ticket can be closed.
Previous Behavior
On activating a popover with no interactive elements, Narrator announces, 'contains style group'.
New Behavior
PopoverSurface no longer applies role='group' unconditionally when is false.
The role is now only set when the consumer provides an accessible name via aria-label or aria-labelledby — matching the WAI-ARIA 1.2 requirement that group must have an accessible name. Without one, the surface renders as a plain div, so Narrator no longer announces "contains style group" when activating a non-modal popover.
Implementation Details
The aria attribute logic has been extracted into a pure function getPopoverSurfaceAriaAttributes to allow isolated unit testing independent of the hook.
The default Popover story has been updated to include aria-label as the recommended usage pattern.
Note for discussion:
This fix stops the incorrect announcement. The broader expected result — Narrator automatically reading the popover text content on open — requires a follow-up decision on focus management vs aria-live.
UX input is needed before that work proceeds.
Fixes
https://dev.azure.com/microsoftdesign/fluent-ui/_workitems/edit/18661