-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
LinkControl: fix scrollbar displayed on toggle link settings #47986
Conversation
Size Change: +465 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Flaky tests detected in 6752cbf. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4162914625
|
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 catching this and for the quick fix 👏
Left one little change.
margin-top: calc(var(--wp-admin-border-width-focus) * -1); | ||
padding: $grid-unit-20; | ||
padding-top: 0; | ||
padding-top: var(--wp-admin-border-width-focus); | ||
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.
Let's group these props together and add a comment briefly explaining why they were added and what the margin/padding stuff is all about. Feel free to drop a link to the this PR in the comment as well.
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 review! I have added my comments, but if they are not clear, feel free to update them.
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 would like to merge this pr 👍
Fixes: #47876
What?
This PR hides the scrollbar that appears when toggling settings in the
LinkControl
component. This problem occurs on Windows; Mac users may be able to reproduce it if the scrollbars are set to "Always".Why?
I think it is due to the popover content having
overflow:auto
.7009058947d612f0d77a08e5dc51f3a2.mp4
How?
Applied
overflow:hidden;
to the parent element of the motion element. However, this style alone will result in a cut-off focus outline:Therefore, I applied padding-top value by the width of the outline border. At the same time, a negative margin-top with the same value was applied on top to avoid changing the appearance.
Testing Instructions
Note: On Mac, you might be able to reproduce this by changing the "General > Show scroll bars" setting to "Always".
Screenshots or screencast
Before
before.mp4
After
after.mp4