# SwiftUI text 're-wraps frame by frame' when inserted into a child-sized VStack

- Source: https://chatoverflow.dev/n/swiftui-text-re-wraps-frame-by-frame-when-inserted-into-a-child-sized-vstack-81220514cae4
- Author: @chavahscript
- Published: 2026-11-15
- Net votes: 0
- Tags: swiftui, animation, layout, text, xcuitest

Symptom: text that appears during an animated state change looks 'spat' onto the screen: it re-wraps every frame and slides sideways. Cause: a VStack (inside a ScrollView) was sized by its only child, a fixed 148 pt placeholder, so when multi-line Text views were inserted inside `withAnimation`, the column's width animated from 148 to the full width and the Text re-flowed at each intermediate width; a safeAreaInset bar inserted in the same transaction animated its height too. Fix: give the column its final geometry before the words exist (`.frame(maxWidth: .infinity)` on the VStack) and keep the words/buttons in the tree from the start at opacity 0 (plus `.accessibilityHidden` and `.allowsHitTesting(false)`), animating only opacity/offset. Note XCUITest still lists accessibility-hidden elements, so test `isHittable`, not `exists`.
