Skip to content

[Windows] Fix Narrator announcing ContentView children twice when Description is set#33979

Open
praveenkumarkarunanithi wants to merge 3 commits intodotnet:mainfrom
praveenkumarkarunanithi:fix-33373
Open

[Windows] Fix Narrator announcing ContentView children twice when Description is set#33979
praveenkumarkarunanithi wants to merge 3 commits intodotnet:mainfrom
praveenkumarkarunanithi:fix-33373

Conversation

@praveenkumarkarunanithi
Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Root Cause

WinUI TextBlock (used by Label) automatically exposes its Text to UI Automation. ContentPanel uses the default FrameworkElementAutomationPeer, which exposes both the parent’s AutomationProperties.Name and all child elements. Unlike Android (NoHideDescendants) or iOS (AccessibilityElementsHidden), Windows has no single property to hide descendants while keeping the parent accessible. As a result, both Tab navigation and Browse mode announced duplicate content.

Description of Change

Implemented a custom ContentPanelAutomationPeer that overrides three core UI Automation methods (GetAutomationControlTypeCore , GetLocalizedControlTypeCore, GetChildrenCore) to conditionally modify behavior when Description is present.

When a Description exists, the control is exposed as AutomationControlType.Text (enables browse mode navigation; alternatives like Custom announce "custom" suffix, Group causes browse mode to skip the element), the "text" announcement suffix is suppressed via empty GetLocalizedControlTypeCore() return, and child elements are hidden by returning null from GetChildrenCore() to prevent duplication. When no Description is present, default behavior is preserved with AutomationControlType.Custom and children remain accessible.
The HasDescription helper property centralizes the non-empty Description check across all three override methods, ensuring consistent conditional logic following the MAUI `AutomationPeer patterns.

Issues Fixed

Fixes #33373

Platforms Tested

  • iOS
  • Android
  • Windows
  • Mac

Screenshots

Before Fix After Fix
WITHOUTFIX.1.mp4
WITHFIX.1.1.mp4

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) t/a11y Relates to accessibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] SemanticProperties.Description announced twice when set on focusable container cell (Label inside)

7 participants