Skip to content
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

iOS support LiveRegion semantics in a11y #1258

Merged
merged 10 commits into from
Apr 11, 2024

Conversation

elijah-semyonov
Copy link

@elijah-semyonov elijah-semyonov commented Apr 10, 2024

Proposed Changes

Add UIAccessibilityTraitUpdatesFrequently to elements with associated SemanticsNode having a LiveRegion property.
Don't return a non-null refocused element if it's the same one before the sync unless it needs to happen (during the scroll to trigger private API).
This prevents accessibility focus change (forcing it to previous element) if the semantics tree is synced continuously due to bug in iOS (UIAccessibilityFocusedElement returns older value)

Testing

Test: When a focused accessibility element has a LiveRegion, it will voice update in a given element.

Issues Fixed

Incorrect refocusing when semantics are synced continuously.

focusedElement?.semanticsNodeId?.let {
accessibilityElementsMap[it]
}
null // No need to refocus to anything
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the old code fixed a case when scroll to next/prev page happens when the user swipes right/left to go to the next/prev element in the list.

@elijah-semyonov elijah-semyonov merged commit f92948f into jb-main Apr 11, 2024
6 checks passed
@elijah-semyonov elijah-semyonov deleted the es/ios-a11y-live-region branch April 11, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants