Hey there,
I know this has already been asked for before, but I'd like to clamp a NumericInput to integers. I don't want commas, or periods. I want the input to only respond to integer changes. Seems simple enough.
Unfortunately I think that some of the internal logic of the numeric input field make it difficult to actually have it be fully controlled.
I'm using the controlled mode, but even if I coerce the value to not include those chars, the input still acts in a slightly uncontrolled manner. For example, I would expect this NumericInput to be totally stuck on "hello":
<NumericInput onValueChange={() => {}} value={"hello"} />
As you can see in this codesandbox, that is not the case. You can change it all you want.
https://codesandbox.io/s/4qm5p6my14
Am I missing something here? The current "controlled" behavior seems very uncontrolled.
I need a truly controlled component if I want to implement my custom integer-only input.
Thanks!
Thanks for the code sandbox. I agree that a more fully controlled API is desirable for this component.
Most helpful comment
Thanks for the code sandbox. I agree that a more fully controlled API is desirable for this component.