The app to reproduce the problem is simple. It has 2 TextField. The button is just there to print out the value but the problem happens without it too. Run the app in the simulator, select the first text field, enter Bb, select the second text field, Bb becomes Vv in the first field. It happens for me using the hardware keyboard or the keyboard on in the emulator. If I use the hardware keyboard I get 2 messages about failing to fetch the device property, but if I use the emulator keyboard the only thing that is displayed is my print. I entered Dd in the first field, pressed the button, Dd stays in the fiend and prints, then I press the second TextField the Dd changes to Did, press the button again it prints Did. I took the preview out and still no joy. I got this by building a new app, replacing the hello world with the two TextField, the button, and the 2 @state variables. It might depend on having the same 2 characters in the TextField Bb becomes Vv but Do stays as Do. I try stuff by ending the app and starting it over. If you enter Dd it changes to Did and then if you go back to the first field and enter Dd again it stays. I rebooted the system. It's fun to try and guess what it will change to, Tt becomes Ty and Oo becomes Ok. If you use the hardware keyboard and press a key before selecting the field you get the two error messages, then select the field and enter Dd and you get no additional messages. OK, let's make it a bit stranger, I ran my tests emulating an iPhone12 but when I change the emulator to a iPad Pro 9.7 inch Dd becomes did, lower case d on the pad and upper on the phone. the iPad Air also goes to did. Here is the code
import SwiftUI
struct ContentView: View {
@State private var nameX = ""
@State private var displayName = ""
var body: some View {
VStack{
TextField("Player Name", text: $nameX)
TextField("Player Display Name", text: $displayName)
Button ("save") {
print (nameX)
}
}
}
}