Auth Password: Select wrong password for easy editing (#1011)

This commit is contained in:
Alexander Zinchuk 2021-04-16 14:48:26 +03:00
parent 41cb364b40
commit 38278e9548

View File

@ -50,6 +50,15 @@ const PasswordForm: FC<OwnProps> = ({
} }
}, []); }, []);
useEffect(() => {
if (error) {
requestAnimationFrame(() => {
inputRef.current!.focus();
inputRef.current!.select();
});
}
}, [error]);
function onPasswordChange(e: ChangeEvent<HTMLInputElement>) { function onPasswordChange(e: ChangeEvent<HTMLInputElement>) {
if (error) { if (error) {
clearError(); clearError();