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

NumericInput doesn't constain min and max on text entry #1044

Closed
thejjmiller opened this issue Apr 27, 2017 · 4 comments
Closed

NumericInput doesn't constain min and max on text entry #1044

thejjmiller opened this issue Apr 27, 2017 · 4 comments

Comments

@thejjmiller
Copy link

When you have a min and/or max property specified only the up and down arrows are constrained. You can still type in much larger or smaller numbers.

@cmslewis
Copy link
Contributor

cmslewis commented Apr 27, 2017

@thejjmiller We've thought about this in the past. This is not technically a bug; this is consistent with how default input[type="number"]s work.

EDIT: If we wanted to enforce min/max thoroughly, we'd probably do it on blur in addition to on increment. But then there are a few choices:

  1. On blur, clamp out-of-range values (to min/max).
  2. On blur, clear out-of-ranges values.
  3. On blur, set out-of-range values to 0.

What would you expect?

@thejjmiller
Copy link
Author

I agree. That is how I implemented it on my own. On blur set the value to max if it is over max and if under min set to min.

I understand that is what input[type=number] does but still seems like part of having a framework like blueprint is to help fix some of those problems.

Also wanted to say that we really have loved Blueprint and love getting so many new releases.

@cmslewis
Copy link
Contributor

cmslewis commented May 2, 2017

@thejjmiller I opened a PR. Take a look! #1057

@thejjmiller
Copy link
Author

Thank you. Works perfect now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants