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

fix(NumberInput): allow value to be outside min/max, show validation #9121

Merged

Conversation

tw15egan
Copy link
Member

@tw15egan tw15egan commented Jul 6, 2021

Closes #8965

Allows a value prop to be passed in that is larger than the min and max bounds, instead of capping at the min or max. If a value is passed in that exceeds these limits, the validation is shown. If the number steppers are used when an invalid number is shown, it will skip the closest valid number.

Changelog

Removed

  • Removed value capping when a value is passed directly to NumberInput

Testing / Reviewing

In the playground, set the value knob to a number outside the min/max value. The validation should be shown, and the stepper should prevent an invalid increment/decrement.

@tw15egan tw15egan requested a review from a team as a code owner July 6, 2021 15:50
@netlify
Copy link

netlify bot commented Jul 6, 2021

❌ Deploy Preview for carbon-react-next failed.

🔨 Explore the source changes: 20ae401

🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-react-next/deploys/60e5b42d04212e0008a66274

@netlify
Copy link

netlify bot commented Jul 6, 2021

✔️ Deploy Preview for carbon-elements ready!

🔨 Explore the source changes: 20ae401

🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/60e5b42d2bfca20007e58dba

😎 Browse the preview: https://deploy-preview-9121--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Jul 6, 2021

✔️ Deploy Preview for carbon-components-react ready!
Built without sensitive environment variables

🔨 Explore the source changes: 20ae401

🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/60e5b42df55aec0007b8c940

😎 Browse the preview: https://deploy-preview-9121--carbon-components-react.netlify.app

Copy link
Contributor

@jnm2377 jnm2377 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🔥

@sstrubberg sstrubberg enabled auto-merge (squash) July 7, 2021 14:03
@sstrubberg sstrubberg merged commit ef38162 into carbon-design-system:main Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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