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

Min & Max values not honored on calcite-input #622

Closed
pemberdom opened this issue May 24, 2020 · 4 comments
Closed

Min & Max values not honored on calcite-input #622

pemberdom opened this issue May 24, 2020 · 4 comments
Labels
help wanted Issues that the core team needs help with in a sprint. p - low Issue is non core or affecting less that 10% of people using the library Stale Issues or pull requests that have not had recent activity.
Milestone

Comments

@pemberdom
Copy link

pemberdom commented May 24, 2020

When using a calcite-input from type "number", we can set values for min and max.

Those values are honored by the step down/up buttons, but not by the input itself. Greater than max and lesser than min values can be entered.

image image

Is there a way besides adding an extra test in the onCalciteInputChange handler function to have those values rejected?

@pemberdom
Copy link
Author

pemberdom commented May 24, 2020

To add a precision: there's a difference of behavior when incorrect values are entered in the input.
If we consider that same calcite-input having min=1 and max=64, when the onCalciteInputChange handler function is called we receive in e.target.value:

Value entered Value received by the handler
40 40
-5 -5
99 99
"something" "" (empty string)
55.2 55.2
55....2 "" (empty string)

So in the handler we can ignore easily the empty string values, but for the out of bounds numeric values we need to implement an extra test (unless we're missing an error/valid property)?

@macandcheese macandcheese added component-input help wanted Issues that the core team needs help with in a sprint. labels May 28, 2020
@macandcheese
Copy link
Contributor

I believe even a native input with set min and max allows any number to be typed. But, I also think it will try to validate on submission if contained in a form so maybe we can do a better job at checking that.

We should make it as close to native behavior as possible here.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Nov 26, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2020

This issue has been automatically closed due to inactivity.

@github-actions github-actions bot closed this as completed Dec 3, 2020
@jcfranco jcfranco added the p - low Issue is non core or affecting less that 10% of people using the library label Dec 9, 2020
@jcfranco jcfranco added this to the Backlog milestone Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that the core team needs help with in a sprint. p - low Issue is non core or affecting less that 10% of people using the library Stale Issues or pull requests that have not had recent activity.
Projects
None yet
Development

No branches or pull requests

3 participants