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

Adjusting sort order to more closely match VoiceOver #242

Merged
merged 3 commits into from
Mar 14, 2025

Conversation

RoyalPineapple
Copy link
Collaborator

@RoyalPineapple RoyalPineapple commented Mar 13, 2025

This PR resolves Issue #221 which points out two subtle details in VoiceOver's positional element sorting.

  • VoiceOver element sorting always uses accessibility frames, even when a path is present.
  • VoiceOver treats accessibility frames with an origin.y delta of less than 8 to be in line with one another and eligible for sorting by leading -> trailing.

I've confirmed this behavior on device as far back as iOS15. This does not appear to be a change in VoiceOver behavior from any previous versions rather a detail that has been overlooked in our implementation. So we won't need to fork the behavior by version.

This also falls under the 'Correcting Accessibility Element Descriptions' versioning guidance making this change a minor version bump.

@RoyalPineapple RoyalPineapple linked an issue Mar 13, 2025 that may be closed by this pull request
@RoyalPineapple RoyalPineapple changed the title adjusting sort order to more closely match voiceover Adjusting sort order to more closely match VoiceOver Mar 13, 2025
@RoyalPineapple RoyalPineapple marked this pull request as ready for review March 13, 2025 20:27
Copy link
Collaborator

Choose a reason for hiding this comment

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

If path down is 8 pt below path unchanged, shouldn't fifth come before fourth?

Copy link
Collaborator Author

@RoyalPineapple RoyalPineapple Mar 14, 2025

Choose a reason for hiding this comment

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

path is completely ignored for these calculations. Thats the point i was trying to make with the snapshot. Adjusting the frames changes the order, adjusting the path does not.

Perhaps I can make the header and footer labels say this directly.

You can try this view controller out it out on device if you'd like. It blew my mind.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh got it! Sorry I missed this line from your description: "VoiceOver element sorting always uses accessibility frames, even when a path is present."

@RoyalPineapple RoyalPineapple merged commit 86a3ca9 into master Mar 14, 2025
6 checks passed
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.

Sort ordering does not match VoiceOver order
3 participants