Skip to content

Commit

Permalink
fix: use toggleHeader from prosemirror-tables (#2412), fix #548
Browse files Browse the repository at this point in the history
Switches the table commands to use `toggleHeader` command instead of the deprecated `toggleHeaderColumn`, `toggleHeaderRow`, and `toggleHeaderCell` commands from `prosemirror-tables`.
  • Loading branch information
jpobley authored Jan 25, 2022
1 parent 82759a8 commit c6bea9a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/extension-table/src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import {
deleteTable,
mergeCells,
splitCell,
toggleHeaderColumn,
toggleHeaderRow,
toggleHeader,
toggleHeaderCell,
setCellAttr,
fixTables,
Expand Down Expand Up @@ -157,10 +156,10 @@ export const Table = Node.create<TableOptions>({
return splitCell(state, dispatch)
},
toggleHeaderColumn: () => ({ state, dispatch }) => {
return toggleHeaderColumn(state, dispatch)
return toggleHeader('column')(state, dispatch)
},
toggleHeaderRow: () => ({ state, dispatch }) => {
return toggleHeaderRow(state, dispatch)
return toggleHeader('row')(state, dispatch)
},
toggleHeaderCell: () => ({ state, dispatch }) => {
return toggleHeaderCell(state, dispatch)
Expand Down

0 comments on commit c6bea9a

Please sign in to comment.