Skip to content

Commit

Permalink
fix bug in useExpandableRecordsGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
storywithoutend committed Nov 13, 2023
1 parent 9d17fd0 commit c336a75
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/hooks/useExpandableRecordsGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ const useExpandableRecordsGroup = <T extends FieldValues>({
shouldDirty: returnAllFields ? Object.keys(otherValues).length > 0 : true,
})
} else {
const newValues = { ...otherValues, [key]: '' }
setValue(group, newValues as PathValue<T, Path<T>>, { shouldDirty: true })
setValue(`${group}.${key}` as Path<T>, '' as PathValue<T, Path<T>>, { shouldDirty: true })
}
}

Expand Down

0 comments on commit c336a75

Please sign in to comment.