fix(Slider): update slider to respect min/max constraints#6232
Merged
tlabaj merged 1 commit intopatternfly:mainfrom Aug 31, 2021
Merged
fix(Slider): update slider to respect min/max constraints#6232tlabaj merged 1 commit intopatternfly:mainfrom
tlabaj merged 1 commit intopatternfly:mainfrom
Conversation
Collaborator
|
PF4 preview: https://patternfly-react-pr-6232.surge.sh |
nicolethoen
approved these changes
Aug 30, 2021
| event.preventDefault(); | ||
| if (onChange) { | ||
| onChange(localValue, localInputValue); | ||
| onChange(localValue, localInputValue, setLocalInputValue); |
Contributor
There was a problem hiding this comment.
I never knew you could do this!
Collaborator
|
Your changes have been released in:
Thanks for your contribution! 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5893
Closes #5707
Additional issues: Related issue #5833
This PR fixes the issue of being able to enter a value outside slider's min/max via the text input, by passing
setLocalInputValueto the user throughonChange.Steps to recreate issue:
valueandinputValueare correctly set to the max value, component state updates & internally updateslocalInputValuevariable which controls the value displayed in the text input.valueandinputValueremain at the max value sosetStatehas no effect and thelocalInputValueis not updated causing above-max value to remain.This PR also fixes the issue of tabbing through the first two "Value input" examples causes the text input to change to 0, and tabbing through a second time causes the slider to reflect this 0 value, by adding missing
newInputValueassignment in example code.