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

deleting decimal values in number inputs #7781

Closed
ccorcos opened this issue Sep 20, 2016 · 4 comments
Closed

deleting decimal values in number inputs #7781

ccorcos opened this issue Sep 20, 2016 · 4 comments

Comments

@ccorcos
Copy link

ccorcos commented Sep 20, 2016

So I already chimed in about the problems here:

#6556

But there's another issue where you type out your number, such as 123.45 and then start deleting and once you delete that 4, the cursor jobs all the way over to the left

https://jsfiddle.net/wmhrdcad/

I think the problem has to do with the fact that \d+\. is not considered a valid number. I'm not sure if this came from react or the browser:

The specified value "0." is not a valid number. The value must match to the following regular expression: -?(\d+|\d+.\d+|.\d+)([eE][-+]?\d+)?

@aweary
Copy link
Contributor

aweary commented Sep 20, 2016

Thanks for the report @ccorcos, we're aware of this and tracking it in #7253

@aweary aweary closed this as completed Sep 20, 2016
@nhunzaker
Copy link
Contributor

Hey @ccorcos!

I've been working on fixes for this issue (#7750, #7359). I listed quite a few cases here (and would be happy to add new cases to that list): #7253 (comment)

Quite an annoying issue. I've got things sorted out for uncontrolled inputs, but there are still some outstanding issues to figure out for controlled inputs (#7359 (comment)). The gist of it is that the value attribute is assigned on every value change, which isn't compatible with Chrome's number input.

Would you be willing to take a look there and help me brain storm?

@nhunzaker
Copy link
Contributor

@aweary ack, sorry! Good timing :)

@aweary aweary reopened this Sep 20, 2016
@aweary aweary closed this as completed Sep 20, 2016
@ccorcos
Copy link
Author

ccorcos commented Sep 20, 2016

@nhunzaker awesome! just commented in the other PR.

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

No branches or pull requests

3 participants