From 5e3cdab96256bd6966910e0f370df297cdea2471 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 18 Dec 2023 16:58:33 +0100 Subject: [PATCH] fix(gapcursor): Don't allow gap cursor in tables Without this, arrow keys can be used to move the gapcursor in between cells and rows. Signed-off-by: Jonas --- src/nodes/Table/TableCaption.js | 1 + src/nodes/Table/TableHeadRow.js | 1 + src/nodes/Table/TableRow.js | 1 + 3 files changed, 3 insertions(+) diff --git a/src/nodes/Table/TableCaption.js b/src/nodes/Table/TableCaption.js index e14dac1956..fce0e0e773 100644 --- a/src/nodes/Table/TableCaption.js +++ b/src/nodes/Table/TableCaption.js @@ -9,6 +9,7 @@ import { Node } from '@tiptap/core' export default Node.create({ name: 'tableCaption', content: 'inline*', + allowGapCursor: false, addAttributes() { return {} }, diff --git a/src/nodes/Table/TableHeadRow.js b/src/nodes/Table/TableHeadRow.js index f85846fc1d..400e7dfeaa 100644 --- a/src/nodes/Table/TableHeadRow.js +++ b/src/nodes/Table/TableHeadRow.js @@ -3,6 +3,7 @@ import TableRow from './TableRow.js' export default TableRow.extend({ name: 'tableHeadRow', content: 'tableHeader*', + allowGapCursor: false, toMarkdown(state, node) { state.write('|') diff --git a/src/nodes/Table/TableRow.js b/src/nodes/Table/TableRow.js index 6525f6ab74..dac5fd1435 100644 --- a/src/nodes/Table/TableRow.js +++ b/src/nodes/Table/TableRow.js @@ -2,6 +2,7 @@ import { TableRow } from '@tiptap/extension-table-row' export default TableRow.extend({ content: 'tableCell*', + allowGapCursor: false, toMarkdown(state, node) { state.write('|')