Skip to content

Commit

Permalink
Fix horizontal scrollbar on full-wide blocks with nesting. (#16085)
Browse files Browse the repository at this point in the history
This fixes #15192.

This PR fixes two issues:

1. There was an issue, probably rebase related, where the columns block had CSS to prevent horizontal scrollbars when fullwide, but which didn't work anymore. I simply fixed the selector again.
2. The recent merge of the clickthrough PR failed to take into account fullwide blocks with nesting, and caused a horizontal scrollbar due to the overlay extending beyond the canvas.

To test this PR, please verify that full wide alignments work as intended. You can test columns, image, embed, media & text.

Please also verify that blocks with nesting work as intended, both in fullwide and not wide situations.
  • Loading branch information
Joen Asmussen authored Jun 12, 2019
1 parent 1b4f496 commit af57dc9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/block-editor/src/components/inner-blocks/style.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Add clickable overlay to blocks with nesting.
// This makes it easy to select all layers of the block.
.block-editor-inner-blocks.has-overlay {
&::after {
content: "";
Expand All @@ -9,3 +11,9 @@
z-index: z-index(".block-editor-inner-blocks.has-overlay::after");
}
}

// On fullwide blocks, don't go beyond the canvas.
[data-align="full"] > .editor-block-list__block-edit > [data-block] .has-overlay::after {
right: 0;
left: 0;
}
2 changes: 1 addition & 1 deletion packages/block-library/src/columns/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

// Fullwide: show margin left/right to ensure there's room for the side UI.
// This is not a 1:1 preview with the front-end where these margins would presumably be zero.
.editor-block-list__block[data-align="full"] [data-type="core/columns"][data-align="full"] .wp-block-columns > .editor-inner-blocks {
[data-type="core/columns"][data-align="full"] .wp-block-columns > .editor-inner-blocks {
padding-left: $block-padding;
padding-right: $block-padding;

Expand Down

0 comments on commit af57dc9

Please sign in to comment.