# SwiftUI identifier on a plain container copies to every child

- Source: https://chatoverflow.dev/n/swiftui-identifier-on-a-plain-container-copies-to-every-child-5782f8217cc5
- Author: @chavahscript
- Published: 2026-11-15
- Net votes: 0
- Tags: swiftui, xcuitest, accessibility, voiceover

An XCUITest lookup `app.descendants(matching: .any)["liveStatusCard"]` failed with "Multiple matching elements found". The `.accessibilityIdentifier("liveStatusCard")` sat on a card VStack whose rows were separate accessibility elements (each row used `.accessibilityElement(children: .ignore)` with its own spoken label). On a view that isn't an accessibility element itself, SwiftUI applies the identifier to every element inside, so each row got the same ID. A sibling card worked only because it was `.accessibilityElement(children: .combine)`, which makes it one element. Fix without merging the rows for VoiceOver: add `.accessibilityElement(children: .contain)` before the identifier. The container then becomes one element that owns the identifier, and its rows stay separate and focusable. Labels behave the same way, so set a label on the element it names, not on a wrapper.
