-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get it in as soon as possible? 😄
It's so much better, let's call it unstable and rename later.
I wouldn't mind seeing splitting in the middle as well for the sake of conistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Enter
from 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
Backspace
from an empty paragraph, the caret should be placed at the end of the caption, but that's an issue inmaster
too.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: