File tree Expand file tree Collapse file tree
packages/core/src/blocks/TableBlockContent Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { callOrReturn , Extension , getExtensionField } from "@tiptap/core" ;
2- import { columnResizing , tableEditing } from "prosemirror-tables" ;
2+ import { columnResizing , goToNextCell , tableEditing } from "prosemirror-tables" ;
33
44export const RESIZE_MIN_WIDTH = 35 ;
55export const EMPTY_CELL_WIDTH = 120 ;
@@ -53,6 +53,17 @@ export const TableExtension = Extension.create({
5353 selectionIsInTableParagraphNode
5454 ) ;
5555 } ,
56+ // Enables navigating cells using the tab key.
57+ Tab : ( ) => {
58+ return this . editor . commands . command ( ( { state, dispatch, view } ) =>
59+ goToNextCell ( 1 ) ( state , dispatch , view )
60+ ) ;
61+ } ,
62+ "Shift-Tab" : ( ) => {
63+ return this . editor . commands . command ( ( { state, dispatch, view } ) =>
64+ goToNextCell ( - 1 ) ( state , dispatch , view )
65+ ) ;
66+ } ,
5667 } ;
5768 } ,
5869
You can’t perform that action at this time.
0 commit comments