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

Sort ordering does not match VoiceOver order #221

Open
g-mark opened this issue Aug 20, 2024 · 0 comments
Open

Sort ordering does not match VoiceOver order #221

g-mark opened this issue Aug 20, 2024 · 0 comments

Comments

@g-mark
Copy link

g-mark commented Aug 20, 2024

A difference in accessibility snapshots was noticed when one of two side by side items changed from providing an outdented acessibilityPath to just using the default accessibilityFrame.

Further investigation found that the AccessibilityHierarchyParser has two potential issues with how elements are ordered in comparison with how VoiceOver works.

  1. The ordering of elements is based on either the accessibilityPath (if not nil) or the accessibilityFrame. VoiceOver seems to always use the accessibilityFrame.
  2. The vertical y comparison of elements uses a strict != comparison, whereas VoiceOver has about a ± 7 pt "roughly equal to" comparison.

This view controller shows some UILabels where one provides a custom accessibilityFrame, and another an accessibilityPath - each insets the view's frame by a different amount. Below is the VoiceOver focus order as seen by the Accessibility Inspector.

Header "Lorem ipsum" label "frame" label "path" label
image image image image

In the snapshot image, however the order is: Header, "path" label, "frame" label, then "Lorem ipsum" label.
image

Sample project: AccessibilityElementOrder.zip

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

No branches or pull requests

1 participant