Strong password autofill, even if we don't want it

Hello,

I have three textfields in a view of my application:

TextField("Email address", text: $email)
SecureField("Password", text: $password)
    .textContentType(.password)
SecureField("Password confirmation", text: $passwordConfirmation)
    .textContentType(.password)

When I tap on the password secure field, iOS show me the strong password view :

If I use this feature, everything is working fine, but if I tap on "Other options..." then "Choose my own password":

The textfields are cleared (that's great), but if I tap on the email textfield (or any other textfields), the password secure field is filled with the strong password that I've just said I don't want...

Here is a video :

And here is my code :

    @State private var email: String = ""
    @State private var password: String = ""
    @State private var passwordConfirmation: String = ""
   
    var body: some View {
        ScrollView {
            VStack(spacing: 16) {
                TextField("Email address", text: $email)
                SecureField("Password", text: $password)
                    .textContentType(.password)
                SecureField("Password confirmation", text: $passwordConfirmation)
                    .textContentType(.password)
            }
            .padding(.vertical, 32)
            .padding(.horizontal, 16)
        }
    }

Any idea ?

Thanks,

Alexandre

I've also stumbled upon this. Trying to create a sign in form and iOS keeps suggesting a new strong password 🤦🏻‍♂️

I was pulling my hair over this, but I finally found a solution for my case. By setting ".textContentType(.username)" on the email field, iOS stopped trying to create a strong password. Very obscure behaviour... Hope it helps you!

Hi @baldursson 👋 I tried to set .textContentType(.username) on my email text field, but the behavior is the same... 😢

I think textContentType should be .newPassword, not .password.

Not sure if that will help though, I've been having similar problems but only on iOS 16. On iOS 15.7 everything works fine.

fixed by set first.contentType = .newPassword and second.contentType = .password

This seems to be a major bug. Setting first.contentType = .newPassword and second.contentType = .password did not work for us. Apple should simply stop suggesting once customer selects "Choose My Own Password"

Hello Everyone, we are experiencing this same problem recently and could not come up with a solution. Basically the problem is that when autofill password is enabled and also the option in the preferences to save the security password via iCloud we have the same problem posted by the OP meaning after filling the password field when we move to the confirm password field, the iOS system shows the same action sheet attached from the OP (String password or Other Options) and if we choose the Other Options action and then Choose My Own Password both field (Password & Confirm Password) will be emptied.

Is this a strange behavior and we as engineer have the responsability to cache the password typed by the user when dealing with iCloud security password & autofill password preferences options or is this a normal behavior?

Thank you everyone for the time, if you have any other further question to ask let me know

I am also seeing this behavior on 16.3 when my text fields have textContentType = .newPassword (UIKit). Has anyone filed feedback? I just filed FB12131005.

Any updates? We are seeing the same issue where tapping on Choose My Own Password does not properly wipe out the text in the text field

Any updates? I'm still experiencing this on iOS 18.

Strong password autofill, even if we don't want it
 
 
Q