-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
I'm not sure if this falls into the feature request or bug category.
Related: #4327
Actual behavior
When we set a value (controlled input) on NumericInput, if the value is either out of the min / max range, or not a multiple of the step size, it prints the following warning to the console (on every render):
Warning
[Blueprint] <NumericInput> controlled value prop does not adhere to stepSize, min, and/or max constraints.
Expected behavior
I don't know the context in which the decision to print this warning was made.
But I would argue that if a user enters a value that is not correct:
- It is not a developer mistake so should not trigger a console warning.
- In order to create the conditions in which the warning never appears, we would need to override what the user typed automatically, which is arguably not good UX.
- It is perfectly normal to go through an invalid value first in order to reach a valid value. Example: range is 10-30 and user enters 20. As they type the first character, the value will be outside of the range.
The warning would make sense for a slider where the user is constrained to the allowed values, but not for a free text input.
Steps to reproduce
This warning can easily be reproduced in the docs:
https://blueprintjs.com/docs/#core/components/numeric-input
If you enter a value out of the min / max range, the warning appears.
Possible solution
Remove the warning entirely.