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

onValuesChange is not invoked in case we do form.setFieldsValue #697

Open
aliaksandr-sakalou-sonatus opened this issue May 22, 2024 · 2 comments

Comments

@aliaksandr-sakalou-sonatus
Copy link

aliaksandr-sakalou-sonatus commented May 22, 2024

It is stated in the document https://github.com/react-component/field-form?tab=readme-ov-file#8-setfields-not-trigger-onfieldschange-and-setfieldsvalue-not-trigger-onvalueschange that it doesn't work by design.
Question is what are the options to do that using the current API? What are the best practices.

We need to do save to db on each form value change but that's not possible because onValuesChange is not invoked when some field reset another field (Example: when field A is updated we reset field B).

Thanks in advance!

@zingxy
Copy link

zingxy commented Jun 6, 2024

useWatch may solve your problem.

@Asanio06
Copy link

I tried to create an merge request but no one take it : #646

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

No branches or pull requests

3 participants