Skip to content

Commit 52fcb1a

Browse files
fix(web): Backspace right after a list shortcut keeps the typed marker
The list item's Backspace binding replaced Tiptap's default without its undoInputRule step, so Backspace after "+ ", "* " or "1. " lifted the new item and lost the marker. Undo the input rule first, as > and # already do. Fixes #31988 AI-assisted; verified with the tests and tools listed above.
1 parent b7b14e6 commit 52fcb1a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎apps/web/src/composer-rich-text-doc.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ const ComposerListItemExtension = ListItem.extend({
486486
addKeyboardShortcuts() {
487487
return {
488488
...withoutBlockChords(this.parent?.(), LIST_NESTING_KEYS),
489-
Backspace: () => backspaceAcrossList(this.editor),
489+
// Replacing Tiptap's Backspace drops its undoInputRule, which keeps a just-typed "+ " literal.
490+
Backspace: () => this.editor.commands.undoInputRule() || backspaceAcrossList(this.editor),
490491
Delete: () => deleteAcrossList(this.editor),
491492
};
492493
},

0 commit comments

Comments
 (0)