-
Notifications
You must be signed in to change notification settings - Fork 711
Modified custom password box implementation and added automation peer for narrator announcement. #1930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… for narrator announcement.
|
/azp run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses a screen reader accessibility issue where password validation suggestions weren't being announced to users. The implementation replaces a visibility-based validation display system with a RichTextBlock that properly supports screen reader announcements through automation peers.
- Migrated from multiple visible/hidden StackPanel elements to a single
RichTextBlockwithAutomationProperties.LiveSetting="Polite" - Added automation peer implementation to trigger
LiveRegionChangedevents for screen reader notifications - Removed redundant password change event handler that was causing duplicate announcements
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ValidatedPasswordBox.xaml | Replaced multiple validation StackPanels with a single RichTextBlock configured for screen reader support |
| ValidatedPasswordBox.cs | Added RichTextBlock content building logic and automation peer event triggering for accessibility |
WinUIGallery/Samples/ControlPages/Fundamentals/Controls/ValidatedPasswordBox.cs
Show resolved
Hide resolved
WinUIGallery/Samples/ControlPages/Fundamentals/Controls/ValidatedPasswordBox.cs
Show resolved
Hide resolved
WinUIGallery/Samples/ControlPages/Fundamentals/Controls/ValidatedPasswordBox.cs
Show resolved
Hide resolved
WinUIGallery/Samples/ControlPages/Fundamentals/Controls/ValidatedPasswordBox.cs
Outdated
Show resolved
Hide resolved
WinUIGallery/Samples/ControlPages/Fundamentals/Controls/ValidatedPasswordBox.cs
Outdated
Show resolved
Hide resolved
WinUIGallery/Samples/ControlPages/Fundamentals/Controls/ValidatedPasswordBox.cs
Show resolved
Hide resolved
WinUIGallery/Samples/ControlPages/Fundamentals/Controls/ValidatedPasswordBox.cs
Show resolved
Hide resolved
WinUIGallery/Samples/ControlPages/Fundamentals/Controls/ValidatedPasswordBox.cs
Outdated
Show resolved
Hide resolved
| Foreground = (Brush)Application.Current.Resources[resourceBrushKey] | ||
| }); | ||
|
|
||
| paragraph.Inlines.Add(new LineBreak()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add linebreak only when adding a new line? Or else will it affect RichEditBox height?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We added newline here, so that the next added line will be added in new line rather than at the same line of the text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the question is why we add newline before a new line coming in. We need to add it only at the point a newline getting added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in this PR #1931
WinUIGallery/Samples/ControlPages/Fundamentals/Controls/ValidatedPasswordBox.cs
Show resolved
Hide resolved
…ub.com/microsoft/WinUI-Gallery into Bug_58168275_narrator_suggestion_issue
|
/azp run |
Bug: [WinUI 3 Gallery: Fundamentals-> Custom &user controls]: Screen reader fails to announce appeared suggestions to the user.
Description:
Custom password box in Custom & user controls page failed to announce suggestion via screen reader.
Fix:
The current design of the password suggestion box works with changing the visibility of the text blocks. However, this design doesn't allow the combined text to be provided for screen reader for announcements and also
AutomationProperties.LiveSettingdoesn't work with visibility change. So, the current design is migrated withRichEditTextBlockwithAutomationProperties.LiveSettingfor screen reader to announce the text changes in the password change event.File Changes:
Code Changes:
FrameworkElementAutomationPeer.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged)after validation updates to notify screen readers of content changes.Tests:
Tested the changes via NarratorBuddy and Narrator.
Screenshots:
