block-experiments icon indicating copy to clipboard operation
block-experiments copied to clipboard

Layout Grid: Better transform to columns option

Open alaczek opened this issue 4 years ago • 2 comments

Layout grid has an option to transform to Columns block. Since both blocks use columns I hoped for a more or less seamless transition. For example, when transforming Layout Grid with two columns, I expected to get Columns block with two columns as well. What actually happens though, is the whole Layout Grid block gets wrapped in Columns block with a single column.

Here's a quick demo: vHMF5nx4mJ

Not sure if this is possible, but I'd love to open up a discussion.

alaczek avatar Mar 03 '21 23:03 alaczek

The option is provided by Gutenberg itself for most blocks, and is not specifically part of the Layout Grid. We can look at adding a custom transform that would improve this.

johngodley avatar Mar 04 '21 08:03 johngodley

When you multi-select two paragraphs and transform them to "Columns", you get two columns. But when you transform one paragraph, you get a columns block with one column.

I could see two ways to improve this, but both ways should arguably happen in the core project:

  1. Either allow the layout grid block to indicate to the transform that it should transform its multiple inner containers, not the master container itself.
  2. Only allow transforming to columns if you've selected more than one block.

The latter seems more likely to make sense.

jasmussen avatar Mar 04 '21 09:03 jasmussen