This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Workaround on accessibility bug on SettingsCard #2525
Merged
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 of the pull request
One of the last changes on SettingsCards control behaviour made it to use the Content of a Button as accessible name whenever its content is a Button, as seen here. This is making the cards on the extension library not having a meaningful accessible name, and making the narrator say nothing as the name of the group when the button is focused.
To fix this, we manually set the accessible name of the SettingCards of the not installed extensions and we put the button inside a StackPanel on the Expander, so it not use the button's content as accessible name.
References and relevant issues
https://dev.azure.com/microsoft/OS/_workitems/edit/49362208
https://dev.azure.com/microsoft/OS/_workitems/edit/49362247
https://dev.azure.com/microsoft/OS/_workitems/edit/49656514
https://dev.azure.com/microsoft/OS/_workitems/edit/49656599
Detailed description of the pull request / Additional comments
As the code on the above link shows, the SettingsCard behaviour is: if the Content of the card is a button, use the button's content as accessible name. This makes all our card that have buttons on the extensions library page to have the accesible name as just the button's text, which is not meaningful on most of the cases and is not desirable on buttons where the content is an icon, as it can't even be narrated.
As this behaviour only happens when the content base class is Button or TextBlock, putting it inside a StackPanel mitigates this with the cost of having a additional group nested.
Validation steps performed
PR checklist