Browse Source

Merge pull request #8756 from weseek/fix/141686-144502-behavior-of-table-operation-in-editor

fix: behaviour of table operation in editor
Yuki Takei 1 year ago
parent
commit
5351db14cc

+ 2 - 2
packages/editor/src/services/table-util/insert-new-row-to-table-markdown.ts

@@ -130,8 +130,6 @@ const removeRow = (editor: EditorView) => {
   const bolPos = editor.state.doc.line(curLine).from;
   const bolPos = editor.state.doc.line(curLine).from;
   const eolPos = editor.state.doc.line(curLine).to;
   const eolPos = editor.state.doc.line(curLine).to;
 
 
-  const nextCurPos = editor.state.doc.lineAt(getCurPos(editor)).to + 1;
-
   editor.dispatch({
   editor.dispatch({
     changes: {
     changes: {
       from: bolPos,
       from: bolPos,
@@ -139,6 +137,8 @@ const removeRow = (editor: EditorView) => {
     },
     },
   });
   });
 
 
+  const nextCurPos = editor.state.doc.lineAt(getCurPos(editor)).to + 1;
+
   editor.dispatch({
   editor.dispatch({
     selection: { anchor: nextCurPos },
     selection: { anchor: nextCurPos },
   });
   });