-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Backspacing the empty list item should create simple empty paragraph.
Possible solution found here
const CustomListItem = ListItem.extend({
addKeyboardShortcuts() {
return {
Enter: () => this.editor.commands.splitListItem(this.name),
Backspace: ({ editor }) => {
const { selection } = editor.state;
const { empty, $anchor } = selection;
const anchorPos = $anchor.pos;
if (
empty &&
anchorPos === $anchor.start() &&
editor.isActive('listItem')
) {
editor.commands.toggleBulletList();
return true;
}
return false;
},
};
},
});```
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working