Skip to content

ui-react: the password sign-in form cannot be saved or filled by Android password managers #2557

Open

Description

@schlessera

Context

Android password managers (Google Password Manager in Chrome, Samsung Pass in Samsung Internet) decide whether to save and fill a sign-in by reading the form's markup. LoginForm gives them very little to work with (packages/ui-react/src/components/connectivity/login-form.tsx:72-123):

  • The password <input> (lines 79-88) has type="password" and autoComplete="current-password webauthn", but no id, no name and no required.
  • There is no submit control. "Sign in" is a kit Button (lines 96-104) with its own onClick. The kit Button is a <div role="button"> (packages/ui-kit/src/primitives/Button.tsx:233-255). The form submits only through implicit submission, as the comment at lines 72-74 says.
  • There is no username field, so the saved credential has no account to file it under.
  • The error banner (lines 91-95) is not tied to the field: there is no aria-invalid and no aria-describedby.

Guide forms/autofill-sign-in-form:

  • "MANDATORY: Use autocomplete="current-password" and id="current-password" for the password input in a sign-in form."
  • "modern browsers also require inputs to have a stable name or id value … and to be in a <form> element with a submit button."
  • "MANDATORY: Add the required attribute to both email and password fields."
  • "Use <button> for buttons … don't use a div or some other random element acting as a button."

#1474 (approved, rulings A and C) migrates the kit Button to a native <button> with default type="button" and explicit type="submit" / type="reset" form actions; a submit Button is valid without onClick. This issue consumes that API rather than adding its own.

Blocked by #1474

The visual baseline brand-login-* (packages/ui-react/tests/browser/brand-placements.layout.tsx:77-84) screenshots this form.

Scope

  • Password input: add id="current-password", name="password", required, enterKeyHint="done". Keep autoComplete="current-password webauthn": this is the only field that can host passkey autofill.
  • Add a username input the user never sees: <input type="text" name="username" autoComplete="username" value={accountName} readOnly hidden> (or visually hidden), placed before the password field. accountName is a new optional LoginForm prop. LoginScreen passes uiConfig.appName, a value that stays the same across reloads.
  • Make "Sign in" a real submit control using ui-kit: Button renders a div with role=button instead of a native button #1474's form-action API: the "Sign in" Button takes type="submit" and drops its onClick duplicate, so the form's onSubmit is the only path. The passkey Button stays a type="button" control with its onClick.
  • Error: give the error container an id. While an error is shown, set aria-invalid="true" and aria-describedby on the password input.
  • Update the comment at lines 72-74 to describe the new submit path.

Out of scope

  • Exposing the server's WEBAUTHN_USER_NAME to the unauthenticated login screen. That would add a field to /auth/methods.
  • A visible <label>, a show-password toggle, or any other visual change. The brand-login-* baselines must not move.
  • Moving the webauthn token to a username field.
  • Any change to the kit Button itself: the native migration, the type prop and the actionable-only rule all belong to ui-kit: Button renders a div with role=button instead of a native button #1474.

Acceptance criteria

  • The password input has id="current-password", name="password", required and enterkeyhint="done". A form-scoped autocomplete="username" input carries accountName.
  • Clicking "Sign in" and pressing Enter in the field both fire one submit event on the form, and onPassword runs once.
  • "Sign in" renders as <button type="submit"> inside the form and the passkey control as <button type="button">; activating the passkey control never submits the form.
  • With an error shown, the password input has aria-invalid="true" and an aria-describedby that resolves to the error text.
  • A markup test asserting the attributes above fails on the tree before the change and passes after.
  • Real-Chrome runtime test: a password sign-in submits the form through the native submit button and the session cookie is set. bun run test:layout shows no change to the brand-login-* screenshots.
  • api-report/ui-kit.txt and api-report/ui-react.txt are unchanged by this issue (the Button API change is ui-kit: Button renders a div with role=button instead of a native button #1474's).

Verification

bun run test packages/ui-react/tests/render/render-smoke.test.tsx
bun run test:layout   # brand-login-* unchanged
bun run test
bun run api-report
bun run typecheck
bun run lint

Contract impact

  • No integration-contract change of its own. LoginForm is internal to ui-react (rendered only by LoginScreen, packages/ui-react/src/components/connectivity/login-screen.tsx:149); the kit Button API change is ui-kit: Button renders a div with role=button instead of a native button #1474's and carries its contract/breaking handling there.
  • This changes a published package's behaviour (the login form's markup), so it needs a changeset.

2026-10-24: rewritten to consume #1474's native Button and its type="submit" form action instead of adding a separate optional type to ButtonProps; the two specifications contradicted each other ("without type, the DOM is unchanged" vs. #1474's native migration). Added Blocked by #1474, refreshed the Button citation, and moved the contract impact to #1474.

Activity

  1. added
    type: fix
    area: ui-react
    area: ui-kit
    priority: p2
    agent-ready
    contract
    on Oct 22, 2026
  2. added
    blocked
    and removed
    contract
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: ui-kitarea: ui-reactblockedpriority: p2type: fix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions