-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix(Form): don't prevent form submission when action='' #2165
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2165 +/- ##
=======================================
Coverage 99.76% 99.76%
=======================================
Files 151 151
Lines 2606 2606
=======================================
Hits 2600 2600
Misses 6 6
Continue to review full report at Codecov.
|
src/collections/Form/Form.js
Outdated
@@ -102,7 +102,7 @@ class Form extends Component { | |||
|
|||
// Heads up! Third party libs can pass own data as first argument, we need to check that it has preventDefault() | |||
// method. | |||
if (!action) _.invoke(e, 'preventDefault') | |||
if (action === undefined) _.invoke(e, 'preventDefault') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that false
and null
are also blocking values. Let's update condition and test assertions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok sure, I was thinking false
and null
would be incorrectly typed here.
Excellent, thanks! |
Released in |
When the action attribute is an empty string it means to submit to the current URL which is quite useful.