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
Remove componentWillReceiveProps from ColorPicker #11772
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
f62cd92
Tests for onChange prop
oandregal f832d72
Tests for onChange prop not being called
oandregal b87fb10
Add is rendered tests
oandregal 78f3171
Input values are lowercased on mount
oandregal b456119
Input values are lowercased on subsequent props updates
oandregal 64d2636
Remove unnecessary onChange declaration
oandregal 19d8639
Extract toLowerCase function
oandregal f081ee7
Remove componentWillReceiveProps lifecycle method
oandregal 828a0fd
Create a separate path for handling input data
oandregal 6a4f78f
Add a state prop to the data lifted up
oandregal d327ce3
Add draft values to state
oandregal 7f84889
Make Input a fully controlled component
oandregal b13e35d
Flatten draft values
oandregal 822c7f2
Consider handleChange event always a draft operation
oandregal 0fc4339
Lift HEX validation up
oandregal fe4f830
Test ColorPicker: use uppercase HEX color value
oandregal e4c37e7
Test ColorPicker: uses React TestRenderer instead of ShallowRenderer
oandregal 0066ffc
Test ColorPicker: draft changes onChange event
oandregal e999df4
Test ColorPicker: commit changes onBlur
oandregal 657af92
Test ColorPicker: commit changes onKeyDown UP
oandregal b60b770
Test ColorPicker: commit changes onKeyDown DOWN
oandregal 35ec3fc
Test ColorPicker: commit changes onKeyDown ENTER
oandregal f023388
Test Input: update tests
oandregal a428e4d
Fire commit or draft change depending on the value length
oandregal b04f979
Delete unused snapshots tests
oandregal 8c31eb1
Test Input: update tests for different value lengths
oandregal a044a92
Make Saturation, Hue, and Alpha pure components
oandregal 0a00c1d
Make Icon pure
oandregal ce76b67
Update snapshot
oandregal 20b9e18
Allow introducing empty values
oandregal 7d3ea74
Do not commit empty values
oandregal 8ffdbd5
Reset draft values when views are toggled.
oandregal 1264fc3
Consider Saturation and Hue when the source=rgb
oandregal 97469bd
Rename handleChange to commitValues
oandregal 8122124
Extract set and reset draft values
oandregal 6d8e0d3
Use switch instead of if/else
oandregal 4f575ab
Refactor source to be taken from view
oandregal 05494bc
Refactor how the colors object is updated.
oandregal 7986e09
Fix linter issue: dependencies comment block
oandregal 8108977
Update tests to new API
oandregal 4c202f7
Remove unnecessary check for Saturation and Hue
oandregal File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
These values above can be zero, so this is causing some trouble with using the keyboard to move through the saturation. If you focus into the saturation handle, you can use shift + left or shift + right (or just left/right) to move the handle, but you can't get it all the way to the edge.
I'm pretty sure this is also the root of this issue,
both seemed fixed if I change this to check forbut of course that breaks the inputs :|isFinite
Edit (again): played with this more, you can use an isFinite check if you cast the value to an int in
normalizeValue
👍