I found the problem. It is the spell checking.
This is the fix:
.disableAutocorrection(true)
I also tried to set properties of the text field for the email address. But it didn't work for me:
.keyboardType(.emailAddress)
.textContentType(.emailAddress)