Fix Listview names for the narrator#796
Open
amarinov-msft wants to merge 2 commits into
Open
Conversation
…1.4.10) Typography, Spacing and Geometry pages showed both horizontal and vertical scrollbars in reflow mode because their reference tables used fixed-width Grid columns and the images used fixed sizes, forcing content wider than the viewport. Disable horizontal scrolling and make the tables reflow via proportional (star) column widths capped with MaxWidth, and let the images scale down (and wrap, on Spacing) so content fits within the available width and only a single vertical scrollbar is needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Basic ListView item template shows only Name, but the item's accessible name fell back to the Person record's ToString(), which dumps every field (including Company). Narrator therefore announced extra, unnecessary information beyond the visible Name. Set AutomationProperties.Name to the bound Name via ItemContainerStyle so the item's accessible name matches the visible content (MAS 1.3.1). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Fixes an accessibility issue on the WPF Gallery Collections ListView page. In the first example, the item template renders only the person's Name, but Narrator also announces extra, unnecessary information, including the Company - flagged under MAS 1.3.1 - Info and Relationships and Trap 1.4 - Uncomprehended Element.
Change
Sample Applications/WPFGallery/Views/Collections/ListViewPage.xamlAdded an
ItemContainerStyleon the firstListViewthat setsAutomationProperties.Name="{Binding Name, Mode=OneWay}"on eachListViewItem. An explicit accessible name on the container takes precedence over the ToString() fallback, so the item's name matches its visible content. Scoped to this example only; the other examples on the page are unchanged.Result
Under Narrator scan mode, each item in the Basic ListView now announces only the person's name, matching what is displayed on screen. The leaked record fields (including Company) are no longer announced, satisfying MAS 1.3.1. Visual appearance is unchanged.
Testing