-
Notifications
You must be signed in to change notification settings - Fork 76
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
Calcite input numeric does not limit typed in numbers to min/max #4566
Comments
This is a browser-specific behavior. We do match the native input behavior in Chrome - to allow only A small difference I noticed between our implementation and the native one (in Chrome), is that when I do think we should generally match native behavior - which in this case would mean not resetting the invalid value to the closest min / max bound. Ostensibly the consumer could perform this validation on blur. Open to thoughts here, but I could see it being equally as confusing to provide a non-standard behavior there. I know there is a planned update to a standalone |
We plan to address validation across components in the near future and have added this issue to an Epic (#4598) for tracking purposes. |
For dev implementation, refer to the Figma documentation: |
Verified in For instance: <calcite-label>Quick! Enter a number between 5 and 10
<calcite-input-number name="what" required max="10" min="5"></calcite-input-number>
</calcite-label> |
Actual Behavior
When using
<calcite-input>
as a number the user is still allowed to type in numbers outside the min/max range. While it was mentioned that this mirrors browser behavior #622 (comment).However
<calcite-input>
as a number also does not allow you to type in non-numeric number which differs from default browser behavior (which allows you to type in non numeric characters).Expected Behavior
We have had bugs introduced because we thought
min
andmax
would actually restrict users from typeing in numbers outside themin
andmax
it seems reasonable that most people actually expect this to limit what users can type in and make it consistent with other calcite components behavior.It seems pretty obvious from #622 and #4276 that people expect
min
andmax
to limit the value users can type into the input.when a number outside the min/max is entered either:
Reproduction Sample
https://developers.arcgis.com/calcite-design-system/components/input/
Reproduction Steps
You can reproduce this in https://developers.arcgis.com/calcite-design-system/components/input/
number
Reproduction Version
beta.81
Relevant Info
No response
Regression?
No response
The text was updated successfully, but these errors were encountered: