tleunen / react-number-editor

Custom number editor (text field) react component
MIT License
70 stars 15 forks source link

Controllable #11

Closed cranesandcaff closed 9 years ago

cranesandcaff commented 9 years ago

So this might use too many Number() calls but it does the job. Thoughts?

tleunen commented 9 years ago

Thanks @cranesandcaff. Please address my comments and squash your commits and I'll merge it

tleunen commented 9 years ago

Ok @cranesandcaff, I just accepter your PR and I'll fix a few things. I'm not merging it back to master yet because I'm still not 100% satisfied when the user types number with decimals in the input field.

With the demo, the value returned to the parent component could be 5. while the user types the value. Not sure this is good since the parent might assume the value will always be a number. But I cannot cast the value because otherwise it's impossible to types decimals :/