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

[NumberInput] When passed value is out of boundary, the value is changed to equal min/max #8965

Closed
JordanWSmith15 opened this issue Jun 21, 2021 · 0 comments · Fixed by #9121
Labels

Comments

@JordanWSmith15
Copy link

JordanWSmith15 commented Jun 21, 2021

What package(s) are you using?

  • [X ] carbon-components-react

Detailed description

Describe in detail the issue you're having.

Scenario : When a value in passed in, but is out of boundary (greater than max or less than min value), the value is set to the min or max boundry. This can cause data integrity issues if value is set on page load or comes in from an outside calculation, rather than being set by the user.

Is this issue related to a specific component

Number Input
https://react.carbondesignsystem.com/?path=/story/components-numberinput--default

What did you expect to happen? What happened instead? What would you like to
see changed?

I would expect that if a value is passed to the component that is outside of the min or max value, the exact value passed is displayed, but a field validation error is also shown. This would be consistent with what currently happens if I try to manually type in a value into the component that is outside of the boundary.

What browser are you working in?

Chrome

What version of the Carbon Design System are you using?

Current

Steps to reproduce the issue

  1. Go to storybook https://react.carbondesignsystem.com/?path=/story/components-numberinput--default
  2. Note that knobs have min=0 , max =100
  3. Set "value" prop to 999
    Result: Value is changed to 100. No error is shown.

result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants