Skip to content

Commit

Permalink
fix(gapcursor): Don't allow gap cursor in tables
Browse files Browse the repository at this point in the history
Without this, arrow keys can be used to move the gapcursor in between
cells and rows.

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- authored and backportbot-nextcloud[bot] committed Dec 18, 2023
1 parent 36ce4f9 commit 5e3cdab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/nodes/Table/TableCaption.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Node } from '@tiptap/core'
export default Node.create({
name: 'tableCaption',
content: 'inline*',
allowGapCursor: false,
addAttributes() {
return {}
},
Expand Down
1 change: 1 addition & 0 deletions src/nodes/Table/TableHeadRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import TableRow from './TableRow.js'
export default TableRow.extend({
name: 'tableHeadRow',
content: 'tableHeader*',
allowGapCursor: false,

toMarkdown(state, node) {
state.write('|')
Expand Down
1 change: 1 addition & 0 deletions src/nodes/Table/TableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { TableRow } from '@tiptap/extension-table-row'

export default TableRow.extend({
content: 'tableCell*',
allowGapCursor: false,

toMarkdown(state, node) {
state.write('|')
Expand Down

0 comments on commit 5e3cdab

Please sign in to comment.