Skip to content

Commit

Permalink
fix(marketo-form): keep modified values when recalculating initial st…
Browse files Browse the repository at this point in the history
…ate (#743)
  • Loading branch information
dstaley committed Oct 4, 2022
1 parent ea84007 commit cbbd508
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/polite-gifts-smell.md
@@ -0,0 +1,5 @@
---
'@hashicorp/react-marketo-form': patch
---

Correctly keep modified values when recalculating initial state
2 changes: 1 addition & 1 deletion packages/marketo-form/form/index.tsx
Expand Up @@ -181,7 +181,7 @@ const Form = ({
useEffect(() => {
if (hasBeenRendered.current) {
methods.reset(calculateDefaultValues(marketoForm.result, initialValues), {
keepDirtyValues: true,
keepValues: true,
})
}
}, [hasBeenRendered, methods, marketoForm, initialValues])
Expand Down

1 comment on commit cbbd508

@vercel
Copy link

@vercel vercel bot commented on cbbd508 Oct 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.