Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/core/src/blocks/TableBlockContent/TableExtension.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { callOrReturn, Extension, getExtensionField } from "@tiptap/core";
import { columnResizing, tableEditing } from "prosemirror-tables";
import { columnResizing, goToNextCell, tableEditing } from "prosemirror-tables";

export const RESIZE_MIN_WIDTH = 35;
export const EMPTY_CELL_WIDTH = 120;
Expand Down Expand Up @@ -53,6 +53,17 @@ export const TableExtension = Extension.create({
selectionIsInTableParagraphNode
);
},
// Enables navigating cells using the tab key.
Tab: () => {
return this.editor.commands.command(({ state, dispatch, view }) =>
goToNextCell(1)(state, dispatch, view)
);
},
"Shift-Tab": () => {
return this.editor.commands.command(({ state, dispatch, view }) =>
goToNextCell(-1)(state, dispatch, view)
);
},
};
},

Expand Down
Loading