anastasis-webui: auto-focus

This commit is contained in:
Florian Dold 2021-10-13 19:34:54 +02:00
parent 3aad5e774d
commit 6f4c0a6fb2
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -585,10 +585,10 @@ function AuthMethodSmsSetup(props: AuthMethodSetupProps) {
}, },
}); });
}; };
//const inputRef = useRef<HTMLInputElement>(null); const inputRef = useRef<HTMLInputElement>(null);
// useLayoutEffect(() => { useLayoutEffect(() => {
// inputRef.current?.focus(); inputRef.current?.focus();
// }, []); }, []);
return ( return (
<AnastasisClientFrame hideNav title="Add SMS authentication"> <AnastasisClientFrame hideNav title="Add SMS authentication">
<div> <div>
@ -601,7 +601,7 @@ function AuthMethodSmsSetup(props: AuthMethodSetupProps) {
Mobile number:{" "} Mobile number:{" "}
<input <input
value={mobileNumber} value={mobileNumber}
//ref={inputRef} ref={inputRef}
style={{ display: "block" }} style={{ display: "block" }}
autoFocus autoFocus
onChange={(e) => setMobileNumber((e.target as any).value)} onChange={(e) => setMobileNumber((e.target as any).value)}