Skip to content

Commit

Permalink
(fix) Remove deleted field from the form context (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmale authored Nov 21, 2024
1 parent a26a78c commit f5fe919
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/repeat/repeat.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const Repeat: React.FC<FormFieldInputProps> = ({ field }) => {
formFields,
methods: { getValues, setValue },
addFormField,
removeFormField,
} = context;

useEffect(() => {
Expand Down Expand Up @@ -108,6 +109,7 @@ const Repeat: React.FC<FormFieldInputProps> = ({ field }) => {
clearSubmission(field);
}
setRows(rows.filter((q) => q.id !== field.id));
removeFormField(field.id);
};

const onClickDeleteQuestion = (field: Readonly<FormField>) => {
Expand Down

0 comments on commit f5fe919

Please sign in to comment.