block-experiments
block-experiments copied to clipboard
Layout Grid: Better transform to columns option
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:

Not sure if this is possible, but I'd love to open up a discussion.
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.
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:
- Either allow the layout grid block to indicate to the transform that it should transform its multiple inner containers, not the master container itself.
- Only allow transforming to columns if you've selected more than one block.
The latter seems more likely to make sense.