Skip to content

Commit

Permalink
Reverting onChange changes
Browse files Browse the repository at this point in the history
  • Loading branch information
amitbadala committed Oct 27, 2023
1 parent 494c5c0 commit e759f13
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
13 changes: 6 additions & 7 deletions lib/build/emailpassword-shared7.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/ts/recipe/emailpassword/components/library/formBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export const FormBase: React.FC<FormBaseProps<any>> = (props) => {
autofocus={field.autofocus}
onInputFocus={onInputFocus}
onInputBlur={onInputBlur}
onChange={(value) => onInputChange({ id: field.id, value: value })}
onChange={onInputChange}
hasError={fstate.error !== undefined}
/>
) : (
Expand All @@ -265,7 +265,7 @@ export const FormBase: React.FC<FormBaseProps<any>> = (props) => {
autoComplete={field.autoComplete}
onInputFocus={onInputFocus}
onInputBlur={onInputBlur}
onChange={(value) => onInputChange({ id: field.id, value: value })}
onChange={onInputChange}
autofocus={field.autofocus}
hasError={fstate.error !== undefined}
/>
Expand Down
7 changes: 5 additions & 2 deletions lib/ts/recipe/emailpassword/components/library/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type InputProps = {
value: string;
onInputBlur?: (field: APIFormField) => void;
onInputFocus?: (field: APIFormField) => void;
onChange?: (value: string) => void;
onChange?: (field: APIFormField) => void;
};

const Input: React.FC<InputProps> = ({
Expand Down Expand Up @@ -77,7 +77,10 @@ const Input: React.FC<InputProps> = ({

function handleChange(event: ChangeEvent<HTMLInputElement>) {
if (onChange) {
onChange(event.target.value);
onChange({
id: name,
value: event.target.value,
});
}
}

Expand Down

0 comments on commit e759f13

Please sign in to comment.