-
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
Fix extra scrollbar appearing when searching in the inserter #66229
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +4 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
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.
This fixes #66161 for me:
trunk | this PR |
---|---|
Not sure if there's anything further we can do to prevent this considering it keeps happening. Maybe we need to add a position: relative wrapper to VisuallyHidden.
A position: relative
wrapper on VisuallyHidden
sounds like a good potential solution, as that would hopefully be easier to manage than making multiple CSS tweaks. For now, I think the changes in this PR are good to bring in. The comments are super helpful, too 🙌
I’m wondering if the Quick demo: absolute-or-margin.mp4Regarding this PR, the changes seem perfectly reasonable and I expect they’d have no unwanted impacts. |
Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: mikachan <mikachan@git.wordpress.org> Co-authored-by: stokesman <presstoke@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org> Co-authored-by: dhruvang21 <dhruvang21@git.wordpress.org>
I just cherry-picked this PR to the wp/6.7 branch to get it included in the next release: bd97661 |
// positioned relative to the tab panel. | ||
// This makes the overflow rule of the panel work correctly, particularly when the | ||
// `VisuallyHidden` component is used within the inserter UI. | ||
position: relative; |
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.
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.
Update: this regression was fixed in #66267. Thanks @tellthemachines for landing it!
…ss#66229) Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: mikachan <mikachan@git.wordpress.org> Co-authored-by: stokesman <presstoke@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org> Co-authored-by: dhruvang21 <dhruvang21@git.wordpress.org>
What?
Fixes #66161
Why?
This is the same kind of issue that has occurred before. The
VisuallyHidden
component is implemented following best practices, but it usesposition: absolute
internally, which means it needs aposition: relative
parent. Without that, due to a CSS quirk, it can overflow a parent of the scroll container, which results in a scrollbar appearing in an unexpected place.Not sure if there's anything further we can do to prevent this considering it keeps happening. Maybe we need to add a
position: relative
wrapper toVisuallyHidden
. I'll think on it!How?
Adds
position: relative
in a couple of places - in the 'tabbed-sidebar' which means we prevent the unexpected overflows ifVisuallyHidden
is used anywhere else unexpectedly. Also ininserter-panel__header
so that if this component is used anywhere else it won't cause unexpected overflows. Comments are added to ensure future devs have context when refactoring these styles.Testing Instructions
Screenshots or screencast
Before
After