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()
}
}
}