Skip to content

Commit

Permalink
fix: validate on submit by default
Browse files Browse the repository at this point in the history
  • Loading branch information
breeg554 committed Dec 2, 2024
1 parent b385bb5 commit c5534e8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/web-remix/app/components/form/fields/text.field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ export const TextInputField = ({
validationBehavior?: ValidationBehaviorOptions;
}) => {
const { name, getInputProps, error } = useFieldContext({
validationBehavior,
validationBehavior: {
whenSubmitted: 'onSubmit',
whenTouched: 'onSubmit',
initial: 'onSubmit',
...validationBehavior,
},
});

return (
Expand Down

0 comments on commit c5534e8

Please sign in to comment.