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

Columns Block: Multiple rows #36161

Closed
dashkevych opened this issue Nov 2, 2021 · 6 comments
Closed

Columns Block: Multiple rows #36161

dashkevych opened this issue Nov 2, 2021 · 6 comments
Labels
[Block] Columns Affects the Columns Block Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended

Comments

@dashkevych
Copy link

dashkevych commented Nov 2, 2021

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:

The_Columns_block.mp4
@stevenlinx stevenlinx added [Block] Columns Affects the Columns Block [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. labels Nov 3, 2021
@Sandstromer
Copy link

Sandstromer commented Nov 3, 2021

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.

@annezazu
Copy link
Contributor

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:

columns.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 :)

@dashkevych
Copy link
Author

dashkevych commented Nov 18, 2021

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.

@annezazu
Copy link
Contributor

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?

@Sandstromer
Copy link

@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: #33687

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Columns Affects the Columns Block Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants