-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
[#9712] fix <input type="number" /> value '.98' should not be equal to '0.98'. #9714
Conversation
… equal to "0.98".
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Awesome. @pingan1927 thanks so much for putting this together! I'll have some time later today or tomorrow morning to give it a thorough review. Thanks again for sending this out! |
I think the code after fixed from v15.5.4 is better than v16.0.0-alpha3. It can reduce the render times if the input type is number. |
@nhunzaker you forgot this PR? |
@pingan1927 Sorry. Busy time... thanks for the ping. Checking it out now. |
@@ -158,6 +159,20 @@ function NumberInputs() { | |||
</TestCase.ExpectedResult> | |||
<NumberTestCase /> | |||
</TestCase> | |||
<TestCase | |||
title="decimal numbers" |
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.
Nitpick: Could you capitalize "Decimal"?
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 have fixed it. Any Problem?
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.
This looks good. My only outstanding concern is that it is possible that this is fixed on the 15.6-dev branch, which has related commits from 16-alpha:
Either way, you've added an important tests/fixtures that I want to merge into the test suite.
So for next steps:
- Let's figure out if the 15.6-dev branch exhibits the incorrect behavior.
- If the upcoming 15.6 release works as intended, revert the ReactDOMInput changes, but let's keep the tests/fixtures
- If 15.6 is not correct, let's figure out what needs to get sent over from master to address the fix.
I'm in the middle of a location move, so my availability isn't the best, but I will do my best to follow up later this week.
I tested with the 15.6 RC and verified that this is still broken there. Testing locally, this should also fix #9884. @nhunzaker I think we should move on this quickly so we can include it in 15.6. |
@aweary Thanks for digging into that! Okay, cool. I put up a build here: This checks out for me. 👍 |
@nhunzaker So what should I do next? |
@pingan1927 Nothing, this is great work! I did more testing on Chrome, Safari, Firefox, and IE11. Everything behaves as expected. Let's get this on 15.6. Great work, @pingan1927! Thank you for your patience. |
cc @flarnie |
@nhunzaker feel free to cherry-pick or merge to 15.6-dev if you didn't already, or I can do it in the morning. Awesome to see this fixed so fast. :) |
… equal to '0.98'. (facebook#9714) * [facebook#9712] fix <input type="number" /> value ".98" should not be equal to "0.98". * fix eslint error * fix label error
fix bug #9712
I found in 15.5.4 is NOT OK, but in 16.0.0-alpha.3 is ok.
In 16.0.0-alpha.3 the number type is not handled separately.
15.5.4 is NOT OK
16.0.0-alpha.3 is OK
the change is base on master. Maybe the pr is worth to accept.