-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Unexpected behavior when hitting backspace on list item with children? #1467
Comments
The commands you have bound to backspace (probably some combination of |
Thank you for the fast response! I think either the Google Docs & Notion behavior (in the linked Loom screen cap) would be reasonable:
I was testing this in the "Basic example" playground (https://prosemirror.net/examples/basic/), so apologies if I missed how to configure the editor to change this behavior. |
ProseMirror schemas tend to work quite differently from Google Docs/Notion documents. Does your schema have a way to represent the kind of documents this creates in those editors? Because typically, orphan indented list items just cannot be represented in ProseMirror schemas. |
A way to keep the doc compatible with the schema is to de-dent the list item (and any of its descendants) -- I've got that working with the below key handler now. But I noticed another related issue that I'm trying to solve: if I hit backspace at the beginning of a paragraph (screenshot 1) that's below a list, the paragraph gets added as a second list item (screenshot 2). I'd expect the paragraph text to be merged into the first list item (screenshot 3).
|
Hi @kasrak did you ever find the solution? We ran into the same issue |
No unfortunately |
I have the following doc:
The cursor is preceding the
f
. I'd like to hit backspace in order to bring the "xfirst" line up to the same line as "hello." Instead what happens is that the "hello" node gets selected, then deleted.Here's a Loom showing the behavior in ProseMirror, Google Docs, and Notion:
https://www.loom.com/share/ad856a801d134478afc23de142c4c2e8
When the list only has a single level (i.e. no sublists), hitting backspace works as I'd expect.
The text was updated successfully, but these errors were encountered: