SwiftUI Bug on tvOS 18 – TextField Broken in Modals

Just noticed a bug in tvOS 18+:

If you present a modal (.sheet or similar) that contains a TextField, click into the text field to select your text from keyboard, then press the Back button, the TextField becomes unclickable and we are not able to update the textfield again.

This behavior didn’t happen in tvOS 17, so it seems to be a regression introduced in tvOS 18.3, tested only on silumator

Repro steps:

Present a modal with a TextField

Focus and click the TextField

Press the Back button to dismiss the keyBoard

Try clicking the TextField → nothing happens (and textfield is full white)

If anyone has a workaround, I’d love to hear it!

struct ModalView: View {
    @State var text: String = ""
    var body: some View {
        TextField("", text:  $text,
                  prompt: Text("Prompt"))
    }
}

struct ContentView: View {
    
    @State var isModal: Bool = false
    
    var body: some View {
        NavigationView {
            ZStack {
                SwiftUI.Button.init {
                    isModal = true
                } label: {
                    Text("click")
                }
            }
            
        }.sheet(isPresented: $isModal) {
            ModalView()
        }
    }
}

You should probably raise this as a bug in the usual way. It won't really get progressed if it's only posted in these Developer Forums.

You need to raise each issue you find separately at https://feedbackassistant.apple.com/ You can post the FB numbers here if you want, so that others can link to them.

SwiftUI Bug on tvOS 18 – TextField Broken in Modals
 
 
Q