Skip to content

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

fix: allow tabbing inside codeblock that is in a list

thecodrrbb4fd135a43e
diff --git a/packages/editor/src/extensions/list-item/list-item.ts b/packages/editor/src/extensions/list-item/list-item.ts
index f79ef953b..c4e9e0b63 100644
--- a/packages/editor/src/extensions/list-item/list-item.ts
+++ b/packages/editor/src/extensions/list-item/list-item.ts
@@ -5,6 +5,16 @@ export const ListItem = TiptapListItem.extend({
addKeyboardShortcuts() {
return {
...this.parent?.(),
+ Tab: (props) => {
+ const { editor } = props;
+ const { state } = editor;
+ const { selection } = state;
+ const { $from } = selection;
+
+ if ($from.parent.type.name === "codeblock") return false;
+
+ return this.parent?.()?.Tab(props) || false;
+ },
Backspace: ({ editor }) =>
onBackspacePressed(editor, this.name, this.type),
};