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

fix(Form): don't prevent form submission when action='' #2165

Merged
merged 3 commits into from
Oct 16, 2017

Conversation

eug48
Copy link
Contributor

@eug48 eug48 commented Oct 4, 2017

When the action attribute is an empty string it means to submit to the current URL which is quite useful.

@codecov-io
Copy link

codecov-io commented Oct 4, 2017

Codecov Report

Merging #2165 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2165   +/-   ##
=======================================
  Coverage   99.76%   99.76%           
=======================================
  Files         151      151           
  Lines        2606     2606           
=======================================
  Hits         2600     2600           
  Misses          6        6
Impacted Files Coverage Δ
src/collections/Form/Form.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee931d2...defe600. Read the comment docs.

@@ -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')
Copy link
Member

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

Copy link
Contributor Author

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.

@levithomason levithomason merged commit 0b38567 into Semantic-Org:master Oct 16, 2017
@levithomason
Copy link
Member

Excellent, thanks!

@levithomason
Copy link
Member

Released in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants