question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[@mantine/form] setFieldValue doesn't trickle down on nested fields

See original GitHub issue

What package has an issue

@mantine/form

Describe the bug

When a form has nested fields, calling setFieldValue on the nested fields parent does not clear the dirty state or the error state of its nested fields. This is problematic because you can end-up in confusing states like a form for which form.values === initialValues but form.isDirty() returns true.

See attached sandbox for a live example of the problem.

What version of @mantine/hooks page do you have in package.json?

5.7.1

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/s/peaceful-browser-3kgjf4?file=/src/App.tsx

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Possible fix

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:3
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
gdostiecommented, Nov 18, 2022

When trying out idea 2 on my side, I noticed https://github.com/mantinedev/mantine/issues/3001

1reaction
rtivitalcommented, Nov 12, 2022

@auronsan1st There is already some logic that clears errors for lists, maybe it can be applied for this case? https://github.com/mantinedev/mantine/blob/dev/src/mantine-form/src/clear-list-state/clear-list-state.ts

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing nested forms gracefully with Formik - Rajesh Naroth
The form itself containing fields. All of these are linked via the field names. Here is how I handle a simple form: import...
Read more >
Antd: How to set nested field value using setFieldsValue
So I have a nested dynamic form, and I want to check its value using getFieldsValue . But whenever I do, it doesn't...
Read more >
Nested tooltips don't function as intended - mantinedev/mantine
Nested tooltips seem to inherit each-others properties leading to ... mantine [@mantine/form] setFieldValue doesn't trickle down on nested ...
Read more >
wrong command in "usage with vite guide",about mantinedev ...
wrong command in "usage with vite guide" about mantine HOT 4 CLOSED ... [@mantine/form] setFieldValue doesn't trickle down on nested fields HOT 7 ......
Read more >
List of Form-fields Github Repository Issues - Github Lab
Mantinedev /mantine [@mantine/form] setFieldValue doesn't trickle down on nested... 7. ### What package has an issue @mantine/form ### Describe the bug When ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found