-
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
GradientPicker: remove padding and disable overflow of color picker popovers #55265
GradientPicker: remove padding and disable overflow of color picker popovers #55265
Conversation
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.
Thanks for the PR!
It's working as expected, but I'd like to leave a few comments.
@@ -81,7 +81,6 @@ export const ColorfulWrapper = styled.div` | |||
align-items: center; | |||
width: 216px; | |||
height: auto; | |||
overflow: hidden; |
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.
If this style is removed, an unintended scroll bar will appear when I move the pointer to the right edge of the regular color picker. This problem can be reproduced on Windows, but it might be possible to reproduce it on MacOS by changing the scroll bar settings.
However, strangely, this problem does not occur in #55149, where the same style has been removed.
7eb7c82e55ad7e1c86ebb3999f2e2f63.mp4
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 that's because it's missing the change to packages/components/src/color-palette/index.tsx
setting resize: false
for that specific instance of dropdown.
This can be confirmed by removing the resize : false
change in this PR in the packages/components/src/custom-gradient-picker/gradient-bar/control-points.tsx
file, and noting how the popover in GradientPicker
will also start scrolling.
In short, I think this is behaving as expected.
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.
Looks great! 🚀
Co-authored-by: Aki Hamano <[email protected]>
ab5ecbc
to
f1019df
Compare
Flaky tests detected in 381fe99. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6493032039
|
What?
As flagged by @t-hamano in #55149 (comment), popovers containing the
ColorPicker
in theGradientPicker
component include some padding around the color picker. This PR removes the padding (and overflow: hidden styles) to have the popover look more uniform with other similar color picker popovers.Why?
UI polish and consistency
How?
ColorPicker
-specific stylesresize: false
popover prop (which also causesoverflow: hidden
styles to be applied)DropdownContentWrapper
component to easily remove the popover's internal paddingTesting Instructions
GradientPicker
Storybook exampleScreenshots or screencast
trunk
)