Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

form.watch does not trigger when form.initialize is called #6638

Closed
2 tasks done
raulfpl opened this issue Aug 6, 2024 · 0 comments · Fixed by #6639
Closed
2 tasks done

form.watch does not trigger when form.initialize is called #6638

raulfpl opened this issue Aug 6, 2024 · 0 comments · Fixed by #6639

Comments

@raulfpl
Copy link
Contributor

raulfpl commented Aug 6, 2024

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.12.0

What package has an issue?

@mantine/form

What framework do you use?

Vite

In which browsers you can reproduce the issue?

All

Describe the bug

When using and uncontrolled form and form.watch will not trigger when form.initialize is called. In this case, the value will correctly update but the change will not be transmitted to the form.watch subscribers.

The expected behavior is the subscribers being called every time the value changes, including by the form initialization using form.initialize.

In the provided codesandbox it is shown an example of a staled value (empty) being rendered because of this problem.

If possible, include a link to a codesandbox with a minimal reproduction

https://codesandbox.io/p/sandbox/elegant-saha-h5cs6f

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue
raulfpl added a commit to raulfpl/mantine that referenced this issue Aug 6, 2024
@raulfpl raulfpl changed the title form form.watch does not trigger when form.initialize is called form.watch does not trigger when form.initialize is called Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant