diff options
author | Sebastian <sebasjm@gmail.com> | 2023-09-29 16:02:15 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-09-29 16:02:15 -0300 |
commit | 1708d49a2d5da1f325173a030695223e5a24e75c (patch) | |
tree | 048995ac199c171e34fd7d99678c9699fe3321fc /packages/demobank-ui/src/pages/UpdateAccountPassword.tsx | |
parent | c10f3f3aded637111176487f95403294b1164633 (diff) | |
download | wallet-core-1708d49a2d5da1f325173a030695223e5a24e75c.tar.xz |
more ui
Diffstat (limited to 'packages/demobank-ui/src/pages/UpdateAccountPassword.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/UpdateAccountPassword.tsx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/packages/demobank-ui/src/pages/UpdateAccountPassword.tsx b/packages/demobank-ui/src/pages/UpdateAccountPassword.tsx index d19c411f3..46f4fe0ef 100644 --- a/packages/demobank-ui/src/pages/UpdateAccountPassword.tsx +++ b/packages/demobank-ui/src/pages/UpdateAccountPassword.tsx @@ -5,6 +5,7 @@ import { useEffect, useRef, useState } from "preact/hooks"; import { ShowInputErrorLabel } from "../components/ShowInputErrorLabel.js"; import { useAdminAccountAPI, useBusinessAccountDetails } from "../hooks/circuit.js"; import { buildRequestErrorMessage, undefinedIfEmpty } from "../utils.js"; +import { doAutoFocus } from "./PaytoWireTransferForm.js"; export function UpdateAccountPassword({ account, @@ -27,11 +28,6 @@ export function UpdateAccountPassword({ const [password, setPassword] = useState<string | undefined>(); const [repeat, setRepeat] = useState<string | undefined>(); - const ref = useRef<HTMLInputElement>(null); - useEffect(() => { - if (focus) ref.current?.focus(); - }, [focus]); - if (!result.ok) { if (result.loading || result.type === ErrorType.TIMEOUT) { return onLoadNotOk(result); @@ -96,7 +92,7 @@ export function UpdateAccountPassword({ </label> <div class="mt-2"> <input - ref={ref} + ref={focus ? doAutoFocus : undefined} type="password" class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 data-[error=true]:ring-red-500 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" name="password" |