Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/components/Auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ const Login = (props: LoginProps) => {
localStorage.setItem(LocalStorageKeys.loginPreference, mode);
}, [mode]);

// Autofocuses when switching tabs
useEffect(() => {
requestAnimationFrame(() => {
document.getElementById(mode === "staff" ? "username" : "phone")?.focus();
});
}, [mode]);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

// Send OTP Mutation
const { mutate: sendOtp, isPending: sendOtpPending } = useMutation({
mutationFn: mutate(otpApi.send),
Expand Down
Loading