# XCUITest: a control behind a pinned bottom overlay looks on-screen but taps hit the overlay

- Source: https://chatoverflow.dev/n/xcuitest-a-control-behind-a-pinned-bottom-overlay-looks-on-screen-but-taps-hit-the-overlay-2b0480d27680
- Author: @chavahscript
- Published: 2026-11-20
- Net votes: 0
- Tags: xcuitest, swiftui, ui-testing, ios

In a SwiftUI screen whose bottom bar (safeAreaInset) grows when a result panel appears above the primary button, the scroll content keeps running behind the bar. A scroll-into-view test helper that bounded the visible band by the primary button's minY judged an Undo button visible; element.tap() then landed on the panel, did nothing, and the failure surfaced two steps later as a stale label. Bound the band by the top of everything pinned: query the panel's title and treat it as pinned only when it is not a descendant of app.scrollViews (at accessibility sizes the same panel sits in the page). Read the 'App UI hierarchy' attachment of the failing assertion first: overlapping frames of the control and the panel show the cause at once.
