Gutenberg: List block: p to list to p breaks the p in multiple blocks

Created on 30 Jan 2019  路  10Comments  路  Source: WordPress/gutenberg

gif - list block split in p

When a paragraph block is converted to a list block and back, each item in the list is split into multiple paragraph blocks instead of reverting to the initial state.

  1. (Optional) make a paragraph with multiple list items (separated by <br>), convert to list.
  2. Convert the list back to paragraphs

Note: the transformation isn't wrong by itself. It follows a certain logic to have the list split in this way. Yet, it also felt odd the first time I saw it happening. So take this more of a discussion:

  • to clarify what should be the intended behaviour
  • if we can do something to make it less odd
[Block] List [Feature] Writing Flow [Type] Enhancement

Most helpful comment

Are there downsides?

No argument comes to mind. I've labeled this so we can find it once new work around multi-selection is done.

All 10 comments

I absolutely agree this really can break the flow when happens.

What's the alternative here? I agree that it's bad especially when it happens when you click "backspace" but as a transform, it does feel normal to me?

The simpler alternative is the reverse transform in the gif above at the beginning (p to list): convert to a single p block with <br>s.

But, as said, it's not "wrong" to think either way.

I'll add the current transform is optimized for the fact that you can multi-select the paragraphs and transform them back to the list block.

I think there's value in the current transformation to multiple paragraphs, but I sympathise with the issue. I wonder if we could instead solve this by having multi-selection support to transform multiple paragraphs into one multi-line paragraph.

Yep I agree there's value. I feel the biggest oddity is that one block becomes many blocks, which feels unexpected.

If we don't want to convert to a single block, maybe we can consider pre-selecting all the blocks when switched, so it's possible to switch back and feels they are "one thing"?

If we don't want to convert to a single block, maybe we can consider pre-selecting all the blocks when switched, so it's possible to switch back and feels they are "one thing"?

Maybe? I'm not sure it's a pattern we'd like to introduce. That's also what the Undo button is for, and its existence has in general justified allowing transformations to be asymmetric.

I feel it's a sensible pattern tho as it would keep the reference on what changed, and would support visually what got converted.

Are there downsides?

Are there downsides?

No argument comes to mind. I've labeled this so we can find it once new work around multi-selection is done.

There could be two transforms: transform to one paragraph per list or one paragraph per list item.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wpalchemist picture wpalchemist  路  3Comments

moorscode picture moorscode  路  3Comments

aduth picture aduth  路  3Comments

jasmussen picture jasmussen  路  3Comments

franz-josef-kaiser picture franz-josef-kaiser  路  3Comments