-
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
List v2: copy list wrapper when copying list items #42860
Conversation
Size Change: +183 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
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.
This tests great! Tried the instructions also cross editors (GDoc, Pages, Plaintext) and works as expected.
I like this meta info in the clipboard :)
I've found a couple of glitches with nested list (they can be looked at separately from this PR).
Gravacao.de.ecra.a.partir.de.15-08-2022.13.46.48.webm
Gravacao.de.ecra.a.partir.de.15-08-2022.13.47.11.webm |
Not sure what you'd expect here. The nested items are, well, nested to the item you're copying, so it seems appropriate? |
For the second item, it seems like the selection is wrong (based on the position of the toolbar). |
My expectation was that only the parent was copied. I can see why that happens (the nested are child of the item I selected) and it makes sense within the block editor interaction model (selects whole blocks). Though the behavior is different from what typical editors do (docs, office). |
What?
Currently when copying one or multiple list items (or all), they are copied with the list wrapper.
Why?
List items must be copied with a wrapper to be valid HTML.
Currently copied list items can't be pasted outside of lists.
How?
Signals to the copy handler that a wrapper block needs to be created by setting extra clipboard data.
Testing Instructions
Enable experimental list v2.
Create a list with list items. Select a single or a few list items. Copy them and paste them in an empty paragraph. What is pasted should be a list (including the correct attributes).
Screenshots or screencast