Writing Flow: allow split out of caption on Enter#22290
Conversation
|
Size Change: +88 B (0%) Total Size: 835 kB
ℹ️ View Unchanged
|
It's fine. The most important part is that the proposal is finally there :)
Should it be rather
For the blocks that have a single item and the caption as the last item, it could move the content after the cursor to a new block. You can explore it separately.
The shared component for caption would be awesome 👍 Super bonus points, Image block could be constructed out of the nested Media (Image variation) and Paragraph (Caption variation) blocks, the container block would have template locking that, doesn't allow to add or remove blocks but maybe you could reorder them :) |
Since we've used split and merge for other props and APIs, I think split might be better? I'm not sure.
I was thinking about that and tried that first, but to be honest I like the subtle boundary between between the blocks. If we implement text splitting of a caption, we also have to implement merging a paragraph with an image. I'm not sure if that makes sense. |
|
Oh I guess |
|
Related to: wordpress-mobile/gutenberg-mobile#426 |
SergioEstevao
left a comment
There was a problem hiding this comment.
Can we please wait before I review this on GB-mobile? Thanks.
|
From my tests this breaks the insertion of multiple lines on the following blocks:
On mobile and web. I'm guessing some props need to be update on the use of RichText component there, or define a default value for the prop that behaves as before. |
0f202bb to
195aa2f
Compare
|
@SergioEstevao Yes, I'm aware of it, the e2e tests did not pass for those. It should be fixed now. |
|
Ooh this will be super valuable! |
Description
Kind of ridiculous that I haven't fixed this earlier. Requires a new RichText prop though because the behaviour is quite different from
onSplit.Should it be marked an unstable API at first?
Should
Enterfrom the middle of a caption create a new empty paragraph below? Maybe be a nicer experience.To do: add this to all other blocks with a caption. Which makes me wonder... should we create a figure-caption component to be used in blocks?
To do: on
Backspacefrom an empty paragraph, the caret should be placed at the end of the caption, but that's an issue inmastertoo.How has this been tested?
Place the caret at the end of an image caption and press
Enter. A new paragraph should be created after the image.Screenshots
Types of changes
Checklist: