Skip to content

Commit aab5953

Browse files
authored
Merge pull request #156 from workfloworchestrator/2067-small-fixes
2067 small fixes
2 parents 17c5919 + 5207ff1 commit aab5953

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'pydantic-forms': patch
3+
---
4+
5+
Calls reset without argument instead of empty object

frontend/packages/pydantic-forms/src/core/PydanticFormContextProvider.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ function PydanticFormContextProvider({
209209
});
210210

211211
const resetFormData = useCallback(
212-
(inputData: object = {}) => {
213-
rhf.reset(inputData);
212+
(inputData?: object) => {
213+
// Resetting without inputData will reset to defaultValues
214+
rhf.reset(inputData || undefined);
214215
},
215216
[rhf],
216217
);

0 commit comments

Comments
 (0)