-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 with value
set does not behave as Controlled component
#2186
Comments
Forgive me if I'm missing something. It looks like NumericInput is simply not implemented to be a controlled component, despite the documentation: I don't see anything that enforces that The best I can guess is that it's "controlled" in the sense that |
👍 I'm facing the same unexpected behaviour. Would be nice and probably not a lot of work to fix it, I Will do it soon if I got some time. This behaviour currently prevent me to implement a cleaner force value to integer, as described here. Because finally what you push into value, is only the first displayed value in the field, due to the internal re-render described by @ablakey |
Investigating, I realised this issue has already a duplicate here => #3553. By the way, looking at my problem and the one mentioned in #3553, we comeback again to this use case about having kind of a mode integer for the component. It has been proposed #1956 but not accepted. I would like to encourage to reconsider it. Of course it's easy to do it yourself (when you have a real controlled component...) but the simplicity of just enable it is valuable from a user point of view. At least ensuring an alternative is working if it's not this precise solution. |
Bug report
Steps to reproduce
Actual behavior
The component freely changes value despite the
value
property being set to a constant.Expected behavior
The component's value shall never change unless the
value
property is changed.The text was updated successfully, but these errors were encountered: