NoHomey / material-ui-number-input

The <TextField type="number" /> that user really expects.

Home Page:http://nohomey.github.io/material-ui-number-input

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

rqloud opened this issue · comments

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.

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 ...

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

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

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.