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

Allow value prop to set value always, not just initially #28

Closed
Elliot128 opened this issue Feb 6, 2017 · 6 comments
Closed

Allow value prop to set value always, not just initially #28

Elliot128 opened this issue Feb 6, 2017 · 6 comments

Comments

@Elliot128
Copy link

Elliot128 commented Feb 6, 2017

This would be useful as I pass a different value into this component than persists on the dom. For instance, this component's input can hold 00001, but I would pass this as a value=1 to prevent leading zeroes.

@s-yadav
Copy link
Owner

s-yadav commented Feb 8, 2017

It is allowed to change value later on. See https://github.com/s-yadav/react-number-format/blob/master/src/number_format.js#L41
Is this not working ?

@Elliot128
Copy link
Author

Elliot128 commented Feb 8, 2017

Here is an example where I'm passing in a value prop that isn't being displayed. This behaves as expected, since your readme specifies that the value prop only sets the initial value. However, I'd like to be able to use value to control the component beyond the initial value.

screen shot 2017-02-08 at 8 55 35 am

@s-yadav
Copy link
Owner

s-yadav commented Feb 19, 2017

Strange I tried this, and it works. Can you try with latest build

@Elliot128
Copy link
Author

Elliot128 commented Feb 20, 2017

On 1.1.0 and this is still occurring.

screen shot 2017-02-20 at 10 03 49 am

@s-yadav
Copy link
Owner

s-yadav commented Feb 25, 2017

Can you setup a codepen / jsfiddle for it. ? Cant reproduce.

@s-yadav
Copy link
Owner

s-yadav commented Jul 9, 2017

There is a possible fix on 2.0.0 alpha as now it block adding leading 0s.

@s-yadav s-yadav closed this as completed Jul 9, 2017
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

2 participants