-
Notifications
You must be signed in to change notification settings - Fork 407
Updated commentsBox example to use event.preventDefault() instead of return false #88
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
Conversation
Adding event.preventDefault(); to the handleSubmit method prevents the browser from submitting the form via standard mechanisms in turn engaging and demonstrating React mechanisms.
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
Thanks for the PR @jaylandro! It looks like the function already calls Side note: you are calling The example should work as expected already. Are you seeing weird behavior? If so, re-open this PR and let me know what browser you are using. If you can deploy the code somewhere live which shows the issue, that would be super handy. |
|
Behavior can be witnesses here: https://firereact-comment.firebaseapp.com/ and you are so right on passing the event, I had created this PR quickly directly in github but failed to pass the event in, as I had in my other project. Browser: Chrome/49.0.2623.110 Thanks |
Passed in the click event for preventDefault on handleSubmit
|
Documentation for React v0.12 notes that |
|
CLAs look good, thanks! |
|
Thanks for linking to the change log. It's interesting that they deprecated
Thanks! |
Passed event into handleSubmit, removed return false.
|
Complete, thank you for your patience @jwngr |
|
🎉 Thanks for the PR! 🎉 |
Adding event.preventDefault(); to the handleSubmit method prevents the browser from submitting the form via standard mechanisms in turn engaging and demonstrating React mechanisms.