fix(ios): accessibility path follows correct position in scroll view - #723
Open
eszlamczyk wants to merge 1 commit into
Open
fix(ios): accessibility path follows correct position in scroll view#723eszlamczyk wants to merge 1 commit into
eszlamczyk wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes an iOS VoiceOver focus-ring positioning/scrolling bug for EnrichedMarkdownText when hosted inside a ScrollView, by avoiding stale screen-space geometry.
Changes:
- Removes use of
accessibilityPath(screen-coordinate, computed/cached) for multi-line text ranges. - Always sets
accessibilityFrameInContainerSpacefor eachUIAccessibilityElement, allowing UIKit to project coordinates to screen space on demand (stays correct while scrolling).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
What/Why?
Fixes #696.
On iOS, VoiceOver drew the focus ring for EnrichedMarkdownText text at the wrong position (and failed to scroll to it) when the component was inside a ScrollView - e.g. a chat feed that appends messages.
Multi-line text ranges described their focus ring with an accessibilityPath in absolute screen coordinates, computed once and cached. Screen coordinates go stale the moment the ScrollView scrolls, so the ring pointed at the text's old position. This drops the screen-space path and describes every accessibility element with
accessibilityFrameInContainerSpace, which UIKit re-projects to the screen on every query, so the geometry stays correct under scroll. (This matches the fix the reporter proposed.)Testing
Screenshots
Before
Screen.Recording.2026-08-28.at.11.21.32.mov
After
Screen.Recording.2026-08-28.at.11.17.19.mov
PR Checklist