[@mantine/form] setFieldValue doesn't trickle down on nested fields
See original GitHub issueWhat package has an issue
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:
- Created 10 months ago
- Reactions:3
- Comments:8 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When trying out idea 2 on my side, I noticed https://github.com/mantinedev/mantine/issues/3001
@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