Peter Lapisu
Peter Lapisu

Reputation: 20975

SecureField not calling onSubmit when Password system popover is presented

The onSubmit is not called on Enter if the passwords system popover is presented

SecureField("Password", text: $password)
    .textContentType(.password)
    .textFieldStyle(FTextFieldStyle())
    .focused($focusedField, equals: .password)
    .onSubmit {
        if canLogin() {
            login()
        } else {
            focusedField = .username
        }
    }

enter image description here

Once the Passwords dialog is gone, the onSubmit works again on enter

How to get it always working

Upvotes: 0

Views: 122

Answers (0)

Related Questions