Skip to content

Commit

Permalink
fix(test): revert last changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fffjacquier committed Jun 20, 2024
1 parent d80d501 commit 4820b9c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions libs/form-builder/src/lib/formBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,6 @@ export function FormBuilder({
render={({ field }) => {
const { ref, onChange, ...fieldRest } = field;

const handleOnChangeFromField = (event: unknown) => {
onChange(event);
trigger(id);
};
const onChangeAttr =
behavior === 'onChangeTriggerByField' ? { onChange: handleOnChangeFromField } : null;

return (
<FormField
id={id}
Expand All @@ -172,7 +165,12 @@ export function FormBuilder({
{...formMeta}
{...meta}
{...fieldRest}
{...onChangeAttr}
onChange={(event) => {
onChange(event);
if (behavior === 'onChangeTriggerByField') {
trigger(id);
}
}}
/>
);
}}
Expand Down

0 comments on commit 4820b9c

Please sign in to comment.