Why does joinBackward behave differently with list nodes?

If the cursor is on empty paragraph and I press backspace which executes joinBackward, the current paragraph is deleted and the cursor moves at the end of the previous paragraph.

But with lists instead of moving the cursor at the end of the previous list item, it creates a new list item.

Why is this?

See this video:

Ok I think I understood why.

When joinBackward moves the cursor to the previous paragraph it does not create new content since the children are inline content, but bullet lists have list items as children. When moving the cursor at the end of the bullet list PM will not “allow a cursor in limbo” and will instead create a new list item to honor the schema.

If this is correct I don’t understand why joinBackward doesn’t simply move the cursor at the end of the last children of the buller list block instead.

No, that’s not what’s happening. When possible, joinBackward will move the current textblock into the block before it—you’ll see the same with a blockquote. You’re conceptually backspacing out the end token of the list and moving the paragraph into it.

1 Like

But what paragraph? Didn’t I just delete the paragraph?