diff --git a/packages/taler-merchant-webui/src/screens/AdminAccountCredentialsScreen.tsx b/packages/taler-merchant-webui/src/screens/AdminAccountCredentialsScreen.tsx index 8e4c5b9d0..f56d23b40 100644 --- a/packages/taler-merchant-webui/src/screens/AdminAccountCredentialsScreen.tsx +++ b/packages/taler-merchant-webui/src/screens/AdminAccountCredentialsScreen.tsx @@ -9,11 +9,12 @@ import { FormActionFooter, useFormFeedback } from "../ui/FormActionFooter.js"; import type { VNode } from "preact"; -import { useState } from "preact/hooks"; +import { useEffect, useRef, useState } from "preact/hooks"; import { Header } from "../ui/Header.js"; import { Button } from "../ui/Button.js"; import { PasswordInput } from "../ui/PasswordInput.js"; import { useTranslation } from "../context/translation.js"; +import { focusFirstEmptyField } from "../utils/focus.js"; export function AdminAccountCredentialsScreen({ instanceId, @@ -37,6 +38,11 @@ export function AdminAccountCredentialsScreen({ fieldError, } = useFormFeedback(); const [pending, setPending] = useState(false); + // The new password is all this page asks for. + const form = useRef(null); + useEffect(() => { + focusFirstEmptyField(form.current); + }, []); const submit = async (event: Event) => { event.preventDefault(); @@ -79,6 +85,7 @@ export function AdminAccountCredentialsScreen({
{t`The account’s existing password will stop working. Existing login tokens remain governed by the backend’s token policy.`}
void submit(event)} class="space-y-5 rounded-xl border border-gray-200 bg-white p-5" >