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:
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user