-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Manually set the automation name of the default color scheme for screen reader #14704
Conversation
@msftbot merge this in 10 minutes |
Hello @carlos-zamora! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
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.
I'm sorry, won't this only work for the default that is set when the page is first navigated to? Will it happen again when you navigate back to the page after changing the default?
Even if it does, it never fixes the name of the non-default color schemes when you navigate back to it... so two or more schemes will be named "xxx default" when you change them.
Is it even a guarantee that the list item container is the same in a virtualized list?
I don't think this should have merged...
Unless we're reconstructing the entire scheme list every time we navigate to, or back to, that page. I don't believe we are doing so...? |
Also, in general, we should try to avoid doing things in "layout updated" handlers. That's a pattern that we used for a very specific reason back in TermControl when it didn't have another event to notify when its size was finalized. This should, at least, have a |
That does seem to be what's happening! At first I thought we would need to 'un-name' the old default scheme's container when a new scheme gets selected as default, but it turns out that when we navigate back to the ColorSchemes page (or the UI refreshes itself because of a change in the json) the old containers don't exist. So we just need to set the new container's name.
Is there a different handler we should use? Because inside |
I was too hasty in saying this, and it was not very nice. I'm sorry about that 😻 |
🎉 Handy links: |
Summary of the Pull Request
When we navigate to the color schemes page, find the default color scheme (if present) and manually set the container's automation name to include the word 'default'.
Note that we don't want to change the actual
ColorSchemeViewModel
's name since that name is used internally to identify schemes. We only want to change theListViewItem
's name, i.e. the container in the SUI.PR Checklist
Validation Steps Performed
Screen reader reads out the 'default' text now. It also correctly reads out the new default scheme if the default scheme is changed via SUI or json.