feat(login): add autoFocus to input components (#11566)

<!--
Please inform yourself about the contribution guidelines on submitting a
PR here:
https://github.com/zitadel/zitadel/blob/main/CONTRIBUTING.md#submit-a-pull-request-pr.
Take note of how PR/commit titles should be written and replace the
template texts in the sections below. Don't remove any of the sections.
It is important that the commit history clearly shows what is changed
and why.
Important: By submitting a contribution you agree to the terms from our
Licensing Policy as described here:
https://github.com/zitadel/zitadel/blob/main/LICENSING.md#community-contributions.
-->

# Which Problems Are Solved

The first input field on login screens is not automatically focused,
requiring users to manually click before typing. This creates
unnecessary friction during the login flow, particularly for
keyboard-oriented users and accessibility scenarios.


# How the Problems Are Solved

- Added the `autoFocus` prop to the first `TextInput` in all 12 login
form components.
- For forms with conditionally rendered first inputs
(`set-password-form` and `register-form-idp-incomplete`), `autoFocus` is
set dynamically so the correct field receives focus depending on which
input is visible.

# Additional Changes

None

# Additional Context

- Closes #11565

Co-authored-by: Max Peintner <[email protected]>
This commit is contained in:
Liam Neville
2026-02-19 09:28:48 +00:00
committed by GitHub
co-authored by Max Peintner
parent 9dd2773e80
commit e25220bfab
25 changed files with 439 additions and 0 deletions
@@ -138,6 +138,7 @@ export function VerifyForm({ userId, loginName, organization, requestId, code, i
<TextInput
type="text"
autoComplete="one-time-code"
autoFocus
{...register("code", { required: t("verify.required.code") })}
label={t("verify.labels.code")}
data-testid="code-text-input"