anastasis-webui: auto-focus
This commit is contained in:
parent
3aad5e774d
commit
6f4c0a6fb2
@ -585,10 +585,10 @@ function AuthMethodSmsSetup(props: AuthMethodSetupProps) {
|
||||
},
|
||||
});
|
||||
};
|
||||
//const inputRef = useRef<HTMLInputElement>(null);
|
||||
// useLayoutEffect(() => {
|
||||
// inputRef.current?.focus();
|
||||
// }, []);
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
useLayoutEffect(() => {
|
||||
inputRef.current?.focus();
|
||||
}, []);
|
||||
return (
|
||||
<AnastasisClientFrame hideNav title="Add SMS authentication">
|
||||
<div>
|
||||
@ -601,7 +601,7 @@ function AuthMethodSmsSetup(props: AuthMethodSetupProps) {
|
||||
Mobile number:{" "}
|
||||
<input
|
||||
value={mobileNumber}
|
||||
//ref={inputRef}
|
||||
ref={inputRef}
|
||||
style={{ display: "block" }}
|
||||
autoFocus
|
||||
onChange={(e) => setMobileNumber((e.target as any).value)}
|
||||
|
Loading…
Reference in New Issue
Block a user