Skip to content

Commit

Permalink
fix removeRow mistake: (row < map.width) -> (row < map.height)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaweiss committed Mar 10, 2021
1 parent 6b16ed3 commit 75b3f0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export function removeRow(tr, {map, table, tableStart}, row) {
let attrs = table.nodeAt(pos).attrs
tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(pos + tableStart), null, setAttr(attrs, "rowspan", attrs.rowspan - 1))
col += attrs.colspan - 1
} else if (row < map.width && pos == map.map[index + map.width]) {
} else if (row < map.height && pos == map.map[index + map.width]) {
// Else, if it continues in the row below, it has to be moved down
let cell = table.nodeAt(pos)
let copy = cell.type.create(setAttr(cell.attrs, "rowspan", cell.attrs.rowspan - 1), cell.content)
Expand Down

0 comments on commit 75b3f0f

Please sign in to comment.