Enter in table cell adds a row after the current one (#4186)

Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
Pablo Yus
2022-09-29 04:03:28 +01:00
committed by GitHub
parent 7c3ad09974
commit 5b33aa6649
3 changed files with 29 additions and 5 deletions

View File

@@ -9,3 +9,13 @@ export default function getRowIndex(selection: CellSelection) {
const path = (selection.$from as any).path;
return path[path.length - 8];
}
export function getRowIndexFromText(selection: CellSelection) {
const isRowSelection = selection.isRowSelection && selection.isRowSelection();
const path = (selection.$from as any).path;
if (isRowSelection) {
return path[path.length - 8];
} else {
return path[path.length - 11];
}
}