final-form / react-final-form

🏁 High performance subscription-based form state management for React
https://final-form.org/react
MIT License
7.38k stars 480 forks source link

`form.pauseValidation` is not working #879

Open michaltk opened 3 years ago

michaltk commented 3 years ago

Are you submitting a bug report or a feature request?

Bug

What is the current behavior?

form.pauseValidation is not working. It seems to be that react-final-form is calling form.resumeValidation after the fields are rendered https://github.com/final-form/react-final-form/blob/92cd23e237b43d1dd8e5598381ab58ae8f97f9ed/src/ReactFinalForm.js#L93 since it called form.pauseValidation initially https://github.com/final-form/react-final-form/blob/92cd23e237b43d1dd8e5598381ab58ae8f97f9ed/src/ReactFinalForm.js#L72 but it's disregarding if anyone had called pauseValidation in the meantime.

What is the expected behavior?

Creating a custom form and calling form.pauseValidation should pause the validation.

Sandbox Link

https://codesandbox.io/s/new-star-vcrxo

What's your environment?

react-final-form:6.5.2 final-form:4.20.1

jakub-zebrowski commented 2 years ago

Is there any update on that topic? I would really appreciate any info since this thing is important in my project :)