gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Columns Block: Multiple rows

Open dashkevych opened this issue 5 years ago • 6 comments

Description

The Columns block is designed to display items in a single row. We can create additional row by adding additional Columns block.

For example, to create a three columns layout with two rows, we can use two Columns block with a three columns layout:

Regular views

However, on some cases, we can see a broken layout due to default styles for the Columns block, which changes the width of a column to 50%:

Smaller views

Are there any solutions for this issue?

Step-by-step reproduction instructions

Add two Columns blocks with a three columns layout to the content area.

Here is a screenshot from the Block editor:

Editor view

  • WordPress: 5.8.1
  • Theme: Twenty Twenty-One (Version: 1.4)

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

The Gutenberg plugin is inactive. I am using functionality which comes from a WordPress core, without any plugins.

Here is the same outcome with an active Gutenberg plugin (v11.8.0) and the 'Stack on mobile' option toggled on:

https://user-images.githubusercontent.com/3655965/140131243-760c4462-425a-4a3c-8eac-accbe562fcb0.mp4

dashkevych avatar Nov 02 '21 23:11 dashkevych

I don't think this is considered a broken layout when the 'Stack on mobile' option is toggled on.

At screen width of 599px and less the columns go to 100% wide, and at screen widths of 600px to 781px the columns go to 50% wide as shown in your screenshot.

Edit: sorry just realised that I assumed you have the 'Stack on mobile' option toggled on.

I tested with this off and am unable to recreate the issue.

You didn't mention whether the stack on mobile is on or off.

Sandstromer avatar Nov 03 '21 11:11 Sandstromer

I can replicate this with the stack on mobile option on using Gutenberg 11.9 with WordPress 5.8.2. As far as I know, this is by design to accommodate different screen sizes:

https://user-images.githubusercontent.com/26996883/141589585-7f4c8d1f-ea73-457f-8c96-d9db065ff846.mov

I'm not quite sure if this is an issue as a result rather than intended. I'm going to close this out as a result :)

annezazu avatar Nov 12 '21 23:11 annezazu

I'm not quite sure if this is an issue as a result rather than intended.

This layout works great if we have only three items in a row.

However, if we have multiple rows -- let's say three rows -- then it can cause confusion for the user when viewing a grid in smaller views. Since there are extra spaces in smaller views, the user might think that the grid is broken.

For example, the user has created Services section on the page where a site visitor can find nine services provided by the company.

Default view (it looks like one section)

default-view

Smaller view (it looks like three separate sections)

smaller-view

Expected view in smaller screens

expected-view

Hope there will be a solution in the future WordPress releases.

dashkevych avatar Nov 18 '21 23:11 dashkevych

Thanks for the additional context. @kjellr curious what your thoughts might be considering how much work you're doing with block themes and patterns that might be impacted by this kind of issue?

annezazu avatar Nov 19 '21 00:11 annezazu

@dashkevych, sadly the columns block does not support a grid layout. AFAIK it was never intended to, and I'm not sure it ever will.

There has been some discussion about grid layouts, a recent(ish) one I came across is in relation to the group flex layout and the possibility of also including grid: https://github.com/WordPress/gutenberg/issues/33687

Sandstromer avatar Nov 19 '21 15:11 Sandstromer

For anyone like me who has been wondering where this went, it seems (?) the follow-up issues would be:

  • #16190
  • #32907
    • #32909

nekohayo avatar Apr 04 '24 17:04 nekohayo