Repository navigation
Description
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) hastype="password"andautoComplete="current-password webauthn", but noid, nonameand norequired. - There is no submit control. "Sign in" is a kit
Button(lines 96-104) with its ownonClick. The kitButtonis 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-invalidand noaria-describedby.
Guide forms/autofill-sign-in-form:
- "MANDATORY: Use
autocomplete="current-password"andid="current-password"for the password input in a sign-in form." - "modern browsers also require inputs to have a stable
nameoridvalue … and to be in a<form>element with asubmitbutton." - "MANDATORY: Add the
requiredattribute to both email and password fields." - "Use
<button>for buttons … don't use adivor 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". KeepautoComplete="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.accountNameis a new optionalLoginFormprop.LoginScreenpassesuiConfig.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 itsonClickduplicate, so the form'sonSubmitis the only path. The passkey Button stays atype="button"control with itsonClick. - Error: give the error container an
id. While an error is shown, setaria-invalid="true"andaria-describedbyon 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_NAMEto the unauthenticated login screen. That would add a field to/auth/methods. - A visible
<label>, a show-password toggle, or any other visual change. Thebrand-login-*baselines must not move. - Moving the
webauthntoken to a username field. - Any change to the kit
Buttonitself: the native migration, thetypeprop 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",requiredandenterkeyhint="done". A form-scopedautocomplete="username"input carriesaccountName. - Clicking "Sign in" and pressing Enter in the field both fire one
submitevent on the form, andonPasswordruns 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 anaria-describedbythat 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:layoutshows no change to thebrand-login-*screenshots. -
api-report/ui-kit.txtandapi-report/ui-react.txtare 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 lintContract impact
- No integration-contract change of its own.
LoginFormis internal to ui-react (rendered only byLoginScreen,packages/ui-react/src/components/connectivity/login-screen.tsx:149); the kitButtonAPI change is ui-kit: Button renders a div with role=button instead of a native button #1474's and carries itscontract/breakinghandling 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