Skip to content

Commit

Permalink
fix: input onChange handler (#1040)
Browse files Browse the repository at this point in the history
  • Loading branch information
StereoPT authored Feb 8, 2023
1 parent b7cfba2 commit 25ee6e8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/components/auth/LoginForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ const LoginForm: React.FC<LoginFormProps> = ({ setShowTroubleLogin }) => {
setLoginErrorCode(-1);
};

const handleInputChange = (e: any) => {
const { id } = e.target;
const { value } = e.target;
methods.setValue(id, value);
};

const handleLoginAzure = () => {
if (loading.sso) return;
setLoading((prevState) => ({ ...prevState, sso: true }));
Expand Down Expand Up @@ -116,6 +122,7 @@ const LoginForm: React.FC<LoginFormProps> = ({ setShowTroubleLogin }) => {
placeholder="Email address"
state={loginErrorCode > 0 ? 'error' : undefined}
type="text"
onChange={handleInputChange}
/>
<Input
clearErrorCode={clearErrors}
Expand All @@ -126,6 +133,7 @@ const LoginForm: React.FC<LoginFormProps> = ({ setShowTroubleLogin }) => {
placeholder="Password"
state={loginErrorCode > 0 ? 'error' : undefined}
type="password"
onChange={handleInputChange}
/>

<Button disabled={loading.credentials} size="lg" type="submit">
Expand Down

0 comments on commit 25ee6e8

Please sign in to comment.