-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Cannot copy or delete whole list #3469
Comments
I was able to fix the 3rd issue (the const withNoListlessListItems = editor => {
editor.deleteFragment = (...args) => {
deleteFragment(...args)
const listItems = Editor.nodes(editor, {
match: n => n.type === "list-item",
})
for (const listItem of listItems) {
const parent = Editor.parent(editor, listItem[1])
if (parent && !["ordered-list", "unordered-list"].includes(parent[0].type)) {
Transforms.setNodes(
editor,
{ type: "paragraph" },
{
at: listItem[1],
match: n => n.type === "list-item",
}
)
}
}
}
return editor
} It looks for |
any updates or workarounds for this issue? |
is there any progress on this question,please |
I've noticed this seems to be an issue for all block level nodes. I've encountered the same issue with headers tags, etc. |
Do you want to request a feature or report a bug?
A bug
What's the current behavior?
I can reproduce this in the examples: https://www.slatejs.org/examples/richtext
With this list as the only content in the editor:
Cmd+A to select all appears to select the whole list:
But, if I copy it, only the
<li>
elements are in the html clipboard content, and not the containing<ol>
. This is what happens when I paste into a Google doc:Also If I try to delete, only the list items are deleted, but the list itself stays:
If there is some other content in the editor, like an empty paragraph above the list, then copying works (includes the whole
<ol>
and child<li>
s).Pasted content:
However, if I backspace to delete, this happens...
Note that the bullet lacks indentation and the unordered list toolbar button is not bolded. I inspected the DOM and it looks like there is an
<li>
without a containing<ol>
or<ul>
. There's no way to delete it.Slate: 0.57.1
Browser: Chrome
OS: Mac
What's the expected behavior?
I expected that:
<ol>
or<ul>
.The text was updated successfully, but these errors were encountered: