Announce selected post categories to VoiceOver - #25893
Open
amitraj2203 wants to merge 1 commit into
Open
Conversation
The category rows showed selection only through a checkmark image, which carries no accessibility information. VoiceOver read the same thing for a selected and an unselected category, so the state was conveyed by sight only. Make the cell one accessibility element and give it the selected trait when the category is picked. The state is not added to the label text, so nothing new needs translating. Fixes wordpress-mobile#25737
1 task
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.
Description
Fixes #25737
In the post settings categories picker, selection is shown with a checkmark drawn in an image view. That image carries no accessibility information, so VoiceOver read a selected and an unselected category exactly the same way. The state was available by sight only.
configureRownow makes the cell a single accessibility element and gives it the.selectedtrait when the category is picked. The state is not written into the label text, as the issue asks, so there are no new strings to translate.The cell needs
isAccessibilityElement = truefor this to work: by default UIKit builds the element from the cell subviews, and a trait set on the cell itself never reaches it.configureNoCategoryRowis left alone. It usesaccessoryType = .checkmark, which UIKit already exposes.Testing instructions
VoiceOver does not run in the iOS Simulator, so this was checked with Accessibility Inspector, which reads the same accessibility tree. On a device, VoiceOver reads "Books, selected" for a picked category and "Movies" for one that is not picked.
Before
before.mov
After
after.mov