Skip to content

Commit 36d17aa

Browse files
Fixed setSelection position (#484)
1 parent 08c6de6 commit 36d17aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/extensions/SideMenu/SideMenuPlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ export class SideMenuView<
547547
return;
548548
}
549549

550-
const { contentNode, endPos } = blockInfo;
550+
const { contentNode, startPos, endPos } = blockInfo;
551551

552552
// Creates a new block if current one is not empty for the suggestion menu to open in.
553553
if (contentNode.textContent.length !== 0) {
@@ -561,7 +561,7 @@ export class SideMenuView<
561561
.setTextSelection(newBlockContentPos)
562562
.run();
563563
} else {
564-
this.editor._tiptapEditor.commands.setTextSelection(endPos);
564+
this.editor._tiptapEditor.commands.setTextSelection(startPos + 1);
565565
}
566566

567567
// Focuses and activates the suggestion menu.

0 commit comments

Comments
 (0)