Reveal in-bounds elements covered by floating overlays before failing tappability - #1345
Merged
Conversation
… tappability viewContainingAccessibilityElement:tappable:error:disableScroll: only auto-scrolls when the element's frame lies outside its scroll view's visible rect. An element that is inside the visible rect but occluded by a floating overlay (a tab bar or toolbar hovering over the last rows of a scroll view) skips that scroll and hard-fails the tappability check with "may be blocked by other views". When the tappability check fails and scrolling is allowed, center the element vertically in its nearest scroll ancestor's inset-adjusted viewport, which moves it clear of edge-anchored overlays, then resolve once more with scrolling disabled. If the element is already as centered as the content allows, scrolling cannot uncover it, so the original error is preserved for genuinely blocked elements.
RoyalPineapple
marked this pull request as ready for review
July 24, 2026 12:16
A scroll view acting as the accessibility container resolves as the element's containing view, so the reveal search must start at the view rather than its superview, matching the existing scroll pass.
congt
approved these changes
Jul 24, 2026
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.
Problem
A tap target can sit fully inside its scroll view's visible rect and still be un-tappable because a floating overlay (tab bar, toolbar) hovers over it.
+viewContainingAccessibilityElement:tappable:error:disableScroll:never recovers from this:CGRectContainsRect(visibleRect, elementFrame)), so an in-bounds element is left exactly where it is.is not tappable. It may be blocked by other views.Any list whose last rows extend under a floating bar hits this. In our suite this had already been worked around the only way possible: robot code that detects the failed hit test, walks up to the scroll ancestor, and sets
contentOffsetby hand.Change
When the tappability check fails and scrolling is allowed, center the element vertically in its nearest scroll ancestor's
adjustedContentInset-adjusted viewport, then resolve once more withdisableScroll:YES. Overlays that cause this failure are anchored to the viewport's edges, so centering moves the element out from under them.Safety
testActorAnimationsEnabledand uses the same settle delays (KIFRunLoopRunInModeRelativeToAnimationSpeed, 0.3s/0.05s) as the existing scroll pass.Testing
Validated against a production suite of several hundred KIF integration tests. Rows covered by a floating tab bar on phone-size devices now pass with their hand-rolled scroll workarounds deleted, and no previously-passing test changed behavior. (The same logic ran there first as a swizzle wrapping this method; this PR contributes it natively.)