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

feat(number-input): respect min, max, and step attributes #5906

Merged

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Apr 21, 2020

Closes #5885

This PR adds support for the min, max, and step attributes in the number input component

Testing / Reviewing

Confirm the min, max, and step values are respected when incrementing and decrementing the number input

@emyarod emyarod requested a review from asudoh April 21, 2020 20:14
@emyarod emyarod requested a review from a team as a code owner April 21, 2020 20:14
@ghost ghost requested a review from dakahn April 21, 2020 20:14
@netlify
Copy link

netlify bot commented Apr 21, 2020

Deploy preview for carbon-elements ready!

Built with commit 290fca5

https://deploy-preview-5906--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Apr 21, 2020

Deploy preview for carbon-components-react ready!

Built with commit 290fca5

https://deploy-preview-5906--carbon-components-react.netlify.app

Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

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

Great work 🎉! - Just one thing, would you be able to add tests for mix/max capping with empty <input>? (e.g. for hitting backspace key) - Thanks @emyarod!

Update: I now realized that the changed logic won't be applied for such scenario - My apologies.

@emyarod emyarod force-pushed the 5885-number-input-min-max-step branch from f1fc069 to d5aee2e Compare April 22, 2020 22:31
Copy link
Collaborator

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

Works as expected 💪 👍 ✅

@asudoh
Copy link
Contributor

asudoh commented Apr 25, 2020

@emyarod thinks this is ready to merge - Thanks @emyarod!

@asudoh asudoh merged commit c4233bd into carbon-design-system:master Apr 25, 2020
@emyarod emyarod deleted the 5885-number-input-min-max-step branch April 29, 2020 21:56
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.

Vanilla number input does not respect min, max, or step values
3 participants