Skip to content

Commit bfb19fd

Browse files
committed
fix(Keymap): Add Backspace shortcut to undo input rules
The upstream Tiptap Keymap extension that we don't use (anymore) also provides this. It allows to undo the automatic changes from input rules directly after they got applied by hitting <Backspace>. Unfortunately this doesn't work for nodes that get changed by the TextDirection extension due to a bug, but there's still plenty of input rules where it works, so let's bring it in. Signed-off-by: Jonas <jonas@freesources.org>
1 parent a10882a commit bfb19fd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/extensions/Keymap.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ const Keymap = Extension.create({
2020
emit('text:keyboard:outline')
2121
return true
2222
},
23+
/**
24+
* <Backspace>
25+
* Allows to undo input rules after they got automatically applied
26+
*/
27+
Backspace: () => this.editor.commands.undoInputRule(),
2328
}
2429
},
2530

0 commit comments

Comments
 (0)