If a username field has .autocorrectionDisabled() or .textInputAutocapitalization(.never), tapping the saved login above the keyboard stops working once the user has typed part of their email. Nothing gets filled in. Seen on iPhone 16, iOS 27.0 (24A437).
I've also reported this to Apple through Feedback Assistant (FB24825410).
Steps to reproduce
You need an app with Password AutoFill set up (a webcredentials associated domain) and a saved login for that domain.
- Tap the email field. The saved login appears above the keyboard.
- Type a few letters of the email.
- Tap the saved login.
Expected: the email and password fields fill in, replacing what was typed. Actual: nothing happens.
What works
A username field with only .textContentType(.username) and .keyboardType(.emailAddress). Tapping the saved login fills both fields, no matter how much the user has typed.
What breaks
- With
.autocorrectionDisabled(), the tap works after 1 typed character, but does nothing after 2 or more. - With
.textInputAutocapitalization(.never), the tap does nothing after even 1 typed character. - UIKit has the same problem: a
UITextFieldwithautocorrectionType = .nobehaves like.autocorrectionDisabled().
In all of these cases, choosing the login from the key icon's Passwords sheet still fills both fields. Only the tap on the suggestion above the keyboard fails.
Sample
struct LoginView: View {
@State private var email = ""
@State private var password = ""
var body: some View {
VStack {
TextField("Email", text: $email)
.textContentType(.username)
.keyboardType(.emailAddress)
// Either of these breaks AutoFill once the user types:
.autocorrectionDisabled() // fails after 2+ typed characters
.textInputAutocapitalization(.never) // fails after 1 typed character
SecureField("Password", text: $password)
.textContentType(.password)
}
}
}
Workaround
I removed both modifiers from our username field and it works. Typed emails still didn't get autocorrected in my testing.
Has anyone found a way to keep these modifiers on a username field without breaking AutoFill?
Possibly related: https://developer.apple.com/forums/thread/702970
Thanks for the detailed steps, including the Passwords sheet comparison: filling from the key icon still works when the suggestion above the keyboard doesn't. FB24825410 is the right place for this problem.
Your current configuration matches the example in Enabling Password AutoFill on a text input view. For a service that uses email addresses as usernames, that example sets only the text content type to username and the keyboard type to emailAddress. The documentation describes neither an interaction between AutoFill and the autocorrection or autocapitalization settings nor a way to keep either modifier and avoid this problem.
Without the two modifiers, the default settings apply. The textInputAutocapitalization(_:) documentation gives the default as .sentences. The UIKit autocorrectionType documentation says its default "for most input methods results in autocorrection being enabled." Neither page describes an exception for the username content type or the emailAddress keyboard. The lack of autocorrection in your testing is observed behavior, not a documented guarantee.
For the Fill Strong Password problem in your follow-up, please file a separate report and post its FB number here.