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

Skip Form validating at first render #277

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

duylam
Copy link

@duylam duylam commented Dec 3, 2015

This is to fix issue #254

@tanneess
Copy link

Hi I personally tried your fix. For my use case it missed one extra check in the attachToForm method. This method is also calling this.validate for each component that gets attached to the form => Validation at first render.

@duylam
Copy link
Author

duylam commented Dec 28, 2015

@tanneess Thanks for your feedback, I added the missing check in attachToForm method. Per the article in README.md (http://christianalfoni.github.io/javascript/2014/10/22/nailing-that-validation-with-reactjs.html) I assume the attachToForm() is called only in "mount" event

@eriknyk
Copy link

eriknyk commented Jun 14, 2016

any thoughts from maintainers? is something missing for the PR?

@aphillipo
Copy link

I could do with this being merged - I'm loading lots of data into my forms and validating it means the form is "changed" which it obviously isn't.

@brodrigu
Copy link

👍 for adding the functionality enabled by this PR.

@mikaelengstrom
Copy link

@Semigradsky Is there any reason this have not been merged? Let me know if I can help out in any way.

@andrewdavidcostello
Copy link

This is also a good PR for performance issues. Loading in 125 rows with 5 Selects in each rows causes validation to happen constantly and you have to wait 20 seconds till the form becomes available. This PR works fine for the most part but I get errors stating to remove the prop from the form tag.

The render method needs to be updated to include the prop in nonFormsyProps and in the list above.

To round off performance issues, ideally validation needs disabling when the component is unmounted as well as it tries to validate at this point also. For now I have added a simple check for this to set a validation = false in componentWillUnmount and a check at the top of validate form against it.

@Melonbwead
Copy link

is there any update on this ?

@Semigradsky
Copy link
Collaborator

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 this pull request may close these issues.

9 participants