diff options
Diffstat (limited to 'packages/bank/src/components/AsyncButton.tsx')
-rw-r--r-- | packages/bank/src/components/AsyncButton.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/bank/src/components/AsyncButton.tsx b/packages/bank/src/components/AsyncButton.tsx index 6edd01a..0c43056 100644 --- a/packages/bank/src/components/AsyncButton.tsx +++ b/packages/bank/src/components/AsyncButton.tsx @@ -44,17 +44,17 @@ export function AsyncButton({ const buttonRef = useRef<HTMLButtonElement>(null); useLayoutEffect(() => { - if (grabFocus) { + if (grabFocus) buttonRef.current?.focus(); - } + }, [grabFocus]); // if (isSlow) { // return <LoadingModal onCancel={cancel} />; // } - if (isLoading) { + if (isLoading) return <button class="button">Loading...</button>; - } + return ( <span data-tooltip={rest['data-tooltip']} style={{ marginLeft: 5 }}> |