Skip to content

Commit

Permalink
fix: invalidate the input on form error (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoannfleurydev authored Sep 9, 2024
1 parent 241ef7e commit 2132e46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Form/FieldDate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ export const FieldDate = <
return (
<Controller
{...props}
render={({ field: { ref: _ref, ...field } }) => (
render={({ field: { ref: _ref, ...field }, fieldState }) => (
<Flex flexDirection="column" gap={1} flex={1} {...props.containerProps}>
<DayPicker
placeholder={props.placeholder}
isDisabled={props.isDisabled}
inputProps={{
size: props.size,
autoFocus: props.autoFocus,
isInvalid: !!fieldState.error,
...props.dayPickerInputProps,
}}
{...props.dayPickerProps}
Expand Down

0 comments on commit 2132e46

Please sign in to comment.