Skip to content
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 scrollbars on pattern transforms #55069

Merged
merged 4 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ function PreviewPatternsPopover( { patterns, onSelect } ) {
className="block-editor-block-switcher__preview__popover"
position="bottom right"
>
<div className="block-editor-block-switcher__preview">
<div className="block-editor-block-switcher__preview-title">
{ __( 'Preview' ) }
</div>
<div className="block-editor-block-switcher__preview is-pattern-list-preview">
<BlockPatternsList
patterns={ patterns }
onSelect={ onSelect }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@

.block-editor-block-switcher__preview__popover {
display: none;
overflow: hidden;

// Position correctly. Needs specificity.
&.components-popover {
Expand All @@ -115,6 +116,7 @@
border-radius: $radius-block-ui;
outline: none;
box-shadow: none;
overflow: auto;
}

.block-editor-block-switcher__preview {
Expand All @@ -124,6 +126,10 @@
// Use padding to prevent the pattern previews focus style from being cut-off.
padding: 0 $grid-unit-20;
overflow: hidden;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like I may be undoing my own fix by removing this - #44079.

I think the root issue is that there's a sharing of classnames between two components that do very different things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have resolved this by using a modifier classname unset to remove the overflow only for the patterns menu.

Unpicking the tech debt is unfortunately going to be time consuming, and might not be the best use of time.


&.is-pattern-list-preview {
overflow: unset;
}
}
}

Expand Down
Loading