NoHomey / material-ui-number-input

The <TextField type="number" /> that user really expects.
http://nohomey.github.io/material-ui-number-input
MIT License
29 stars 8 forks source link

min not resetting the input value as expected and preventing negative numbers #7

Closed rqloud closed 7 years ago

rqloud commented 7 years ago

Hey!

If I set the strategy to 'ignore' and min to 20 on https://nohomey.github.io/material-ui-number-input/ and write in the NumberInput the number 10 it doesn't reset to 20. It only works if I write 0 in the NumberInput.

Another issue I noticed is that if I set the min to -20 on 'ignore' the NumberInput still doesn't allow the minus key in the input.

I have the same issues locally.

NoHomey commented 7 years ago

Hi,

As for second notice it is on purpose strategy 'ignore' should ignore all invalid inputs and keep only the last valid.

The first I will check in the weekend.

Sorry it's the end of semester in the university in which I study and I have no time ...

rqloud commented 7 years ago

Thanks for the quick reply. About the second notice, if the min is set to -20 shouldn't the NumberInput allow -10?

NoHomey commented 7 years ago

Well It should my mistake, I'll try to fix it

NoHomey commented 7 years ago

Ok I think I fix the second issue.

I read again the first and my answer is that it's not resetting since if it did it would not allow entering 100 for an example. Imagine this the min is 20 and you want to enter 100 there is no way to do it if it's resetting to 20 when you enter 10 right?

PS. If I all is OK for you I will update the docs since I released new patch version.