Skip to content

Commit 8c65ca0

Browse files
committed
update connectedform
1 parent e2e3cc6 commit 8c65ca0

File tree

1 file changed

+29
-27
lines changed
  • packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes

1 file changed

+29
-27
lines changed

packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/index.tsx

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -61,33 +61,35 @@ export const ConnectedNestedCheckboxes: React.FC<
6161
<Controller
6262
control={control}
6363
name={name}
64-
render={({ field: { value = [], onChange, onBlur, ref } }) => (
65-
<Box as="ul" m={0} p={0}>
66-
{flatOptions.map((option) => {
67-
const states = calculateStates(value, flatOptions);
68-
const state = states.get(option.value)!;
69-
return renderCheckbox(
70-
option,
71-
state,
72-
`${name}-${option.value}`,
73-
isRequired,
74-
isDisabled,
75-
onBlur,
76-
(event) => {
77-
handleCheckboxChange(
78-
option,
79-
event.target.checked,
80-
value,
81-
flatOptions,
82-
onChange,
83-
onUpdate
84-
);
85-
},
86-
ref
87-
);
88-
})}
89-
</Box>
90-
)}
64+
render={({ field: { value = [], onChange, onBlur, ref } }) => {
65+
const states = calculateStates(value, flatOptions);
66+
return (
67+
<Box as="ul" m={0} p={0}>
68+
{flatOptions.map((option) => {
69+
const state = states.get(option.value)!;
70+
return renderCheckbox(
71+
option,
72+
state,
73+
`${name}-${option.value}`,
74+
isRequired,
75+
isDisabled,
76+
onBlur,
77+
(event) => {
78+
handleCheckboxChange(
79+
option,
80+
event.target.checked,
81+
value,
82+
flatOptions,
83+
onChange,
84+
onUpdate
85+
);
86+
},
87+
ref
88+
);
89+
})}
90+
</Box>
91+
);
92+
}}
9193
rules={validation}
9294
/>
9395
);

0 commit comments

Comments
 (0)