Minmal reproducible example:
import SwiftUI
struct ContentView: View {
@State private var text: String = ""
@FocusState private var focused: Bool
var body: some View {
List {
TextField("key", text: $text)
.focused($focused)
if (!focused) {
Section {
Button("click") {
print("click")
}
}
}
}
}
}
For some reason, if I remove one of .focused($focused), if (!focused) { or Section, the error doesn't occur.
Topic:
UI Frameworks
SubTopic:
General
Tags: