SwiftUI TextField height shrinks on first focus in iOS 26/Xcode 26

Hi Everyone,

I’m encountering a layout issue in SwiftUI starting with iOS 26 / Xcode 26 (also reproduced on iPadOS 26). I would like to see whether anyone else has seen the same behaviour, and if there’s any known workaround or fix from Apple.

Reproduction

  • Minimal code:

    struct ContentView: View {
        @State private var inputText: String = ""
    
        var body: some View {
            TextField("", text: $inputText)
                .font(.system(size: 14, weight: .semibold))
                .background(Capsule().foregroundStyle(.gray))
        }
    }
    
  • Environment:

    • Xcode: 26.1 (17B55)
    • Devices / Simulators: iOS 26.0, iOS 26.0.1, iOS 26.1 on iPhone 17 Pro Max; iPadOS 26 on iPad.
    • OS: iOS 26 / iPadOS 26

Observed behaviour

  • When the TextField is tapped for the first time (focus enters), its height suddenly decreases compared to the unfocused state.
  • After this initial focus-tap, subsequent unfocus/focus cycles preserve the height (i.e., height remains “normal” and stable).
  • Prior to iOS 26 (i.e., in older iOS versions) I did not observe this behaviour — same code worked fine.
  • I have not explicitly set .frame(height:) or extra padding, and I’m relying on the default intrinsic height + the Capsule background.

Work-arounds

  • Adding .frame(height: X) (fixed height) removes the issue (height stable).

Thanks in advance for any feedback!

SwiftUI TextField height shrinks on first focus in iOS 26/Xcode 26
 
 
Q