Username & Password Autofill on Mac Application From Safari Only Fills 1 Field at a Time

Number:rdar://FB9184880 Date Originated:2021-06-16
Status:Open Resolved:
Product:SwiftUI/Password Autofill Product Version:SwiftUI 2.0
Classification:Incorrect/Unexpected Behavior Reproducible:Yes
Link to our app for initial reproduction:
Expected Behavior:
    Choosing a password to fill should fill both the username field AND the password field.

Observed Behavior:
    Choosing a password to fill only fills out the individual field that was active/focused before going into the "Passwords..." flow that allows the user to autofill credentials that were previously saved in Safari. We have tried on iMac and MacBook Pro (intel) and it is reproducible for us 100% of the time.

Reproduction Steps:
1. Have some passwords saved in Safari to allow the "Passwords..." modal to pop up when clicking on the username or password fields in the form
2. Bring up the "Passwords..." modal by clicking on the form and beginning to type and click on it
3. Authenticate with the computer user's password to allow access to saved passwords
4. Pick a password
5. Observe that only the username OR password field are filled out

import SwiftUI
import Testable

struct LoginPanelView: View {
    @Binding var email: String
    @Binding var password: String
    @Binding var serverEnvironment: ServerEnvironment
    let onLoginAction: ActionCompletion

    var body: some View {
        VStack(spacing: 8) {
            Text("Sparta Scan")
                .padding(.bottom, 20)
            #if DEBUG
            Picker(selection: $serverEnvironment, label: EmptyView()) {
                ForEach(ServerEnvironment.allCases) {
            }.accessibilityIdentifier("select server")
            TextField("Email", text: $email)
            SecureField("Password", text: $password)
            Button("Login", action: onLoginAction)
                .padding(.top, 20)
                .disabled(email.isEmpty || password.isEmpty)


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!