I have the following code working great in iOS16
TextField(
"Describe...",
text: Binding(
get: { promptText },
set:
{ (newValue, _) in
if let _ = newValue.lastIndex(of: "\n") {
isFocused = false
} else {
promptText = newValue
}
}
),
axis: .vertical
)
but in iOS 17 it breaks. But it breaks in a very mysterious way.
Firstly, the @ FocusState doesn't work.
Setting it to false does not dismiss keyboard. Fine, but also what's weird is that when I press the done button, the new line gets added to the textField anyway, even if I don't set the newValue. What's going on?