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): Custom increment/decrement and thresholds #7159
Conversation
Preview: https://patternfly-react-pr-7159.surge.sh A11y report: https://patternfly-react-pr-7159-a11y.surge.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good! I am noticing some flooring occurring in the following situations however:
- when changing the input via keyboard, pressing Tab to go to the increment button, and pressing Tab again, the input floors to the min (or max if at the max).
- when pressing the buttons to increment/decrement and then clicking outside of the component, the same behavior as above occurs.
It looks like the onBlur is being applied to the input and the buttons, so whenever the buttons lose focus it's causing that newValue to become 0 before running through the ternary when setting the state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome catch @thatblindgeye ! I've updated the component to apply onBlur
only to the text input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Your changes have been released in:
Thanks for your contribution! 🎉 |
What: Closes #7069