-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fixes color picker segmented control rendering and scrolling issues #30994
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4ddd1d9
Fixes collor-palette scrolling issue
8613bc7
Uses existing ANIMATION_DURATION for clarity
047b279
Adds release note
974dd72
Revert "Uses existing ANIMATION_DURATION for clarity"
0aad64a
Revert "Fixes collor-palette scrolling issue"
27a314b
Revert "[RNMobile] SegmentedControls correction (#28740)"
9094f38
Adds delay before scrolling to counteract segmented control delay
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.contentContainer { | ||
flex-direction: row; | ||
flex-direction: row-reverse; | ||
padding: 0 $grid-unit-20; | ||
} | ||
|
||
|
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
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.
I think reverting #28740 is likely a fine approach, but I am curious as to why it was not working.
I haven't explored it fully, but I wonder if the dependency array is not inclusive enough. It included
isCustomGradientColor
, but that value is computed withisSelectedCustom
, which relies upon the valuesactiveColor
,colors
,isGradientSegment
, andisGradientColor
.I would think React would appropriately "watch" for changes to all those sub-dependencies of
isSelectedCustom
, but I wonder if maybe that is not occurring. Maybe we need to declare all of those values as dependencies for this hook?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.
Thank you for your feedback and reviewing this so quickly @dcalhoun 🙇
I was able to reproduce both the reported issues.
I will revisit this with this approach and report back 👍
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.
Hey @dcalhoun 👋
Thank you once more for the tip on this. Passing all the values and doing the calculation within the hook (85ff940) only fixes the disappearing custom gradient and not the original issue. Tbh I'm still a bit confused on why this happens only only compiled builds. I'll continue the investigation and get back 😕
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.
Interesting. #30878 seems like either a style issue (i.e. some flex styles are conflicting or causing rendering issues), a calculation issue (i.e. there is somewhere else where we do not always re-calculate when we should), or a race condition (e.g. a computation occurs during layout and finishes at different times).
I might start by placing "debug styles" on each element to see which element is the offending item "cutting off" the children. Specifically, I know
ScrollView
contains multiple elements, a container and a content container. Which one is rendering too skinny?Relatedly, the broken scroll-to-end for custom colors/gradients (wordpress-mobile/gutenberg-mobile#3104) is likely caused by the same issue where we compute the status within the hook, but do not have a dependency declared on the sub-dependency values.
gutenberg/packages/components/src/color-palette/index.native.js
Lines 102 to 110 in 85ff940
Applying a similar change as 85ff940 would likely resolve the scroll issue.