Skip to content

Commit

Permalink
fix: handle invalid state for field number (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoannfleurydev authored Sep 5, 2024
1 parent 3dabeb9 commit 0de897f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Form/FieldNumber/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const FieldNumber = <
return (
<Controller
{...props}
render={({ field }) => (
render={({ field, fieldState }) => (
<Flex flexDirection="column" gap={1} flex={1} {...props.containerProps}>
<InputGroup size={props.size}>
<InputNumber
Expand All @@ -94,6 +94,7 @@ export const FieldNumber = <
step={props.step}
bigStep={props.bigStep}
isDisabled={props.isDisabled}
isInvalid={!!fieldState.error}
{...props.inputNumberProps}
{...field}
value={formatValue(field.value, 'from-cents')}
Expand Down

0 comments on commit 0de897f

Please sign in to comment.