Modified custom password box implementation and added automation peer for narrator announcement. - #1930
Conversation
… for narrator announcement.
|
/azp run |
There was a problem hiding this comment.
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 |
| Foreground = (Brush)Application.Current.Resources[resourceBrushKey] | ||
| }); | ||
|
|
||
| paragraph.Inlines.Add(new LineBreak()); |
There was a problem hiding this comment.
Should we add linebreak only when adding a new line? Or else will it affect RichEditBox height?
There was a problem hiding this comment.
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.
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.
…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:
