Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: lift empty first list item on backspace

Abdullah Atta9ed291102bb3
diff --git a/packages/editor/src/extensions/list-item/commands.ts b/packages/editor/src/extensions/list-item/commands.ts
index f73088457..7ea916ed2 100644
--- a/packages/editor/src/extensions/list-item/commands.ts
+++ b/packages/editor/src/extensions/list-item/commands.ts
@@ -47,7 +47,9 @@ export function onBackspacePressed(
if (isFirstOfType(type, editor.state)) {
const parentList = getListFromListItem(type, editor.state);
if (!parentList) return false;
- if (parentList.childCount > 1) return editor.commands.deleteNode(type);
+ if (parentList.childCount > 1) {
+ return editor.commands.liftListItem(type);
+ }
return editor.commands.deleteNode(parentList.type);
}