Skip to content

Commit 522adde

Browse files
fix-39: Adding new block removes last character (TypeCellOS#76)
* fix-39: Adding new block remove last character * Minor change and added test * Moved changes to `DraggableBlocksPlugin.ts` * Updated test snapshots --------- Co-authored-by: Matthew Lipski <[email protected]>
1 parent e1f5c7e commit 522adde

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/extensions/DraggableBlocks/DraggableBlocksPlugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ export class BlockMenuView {
379379
.BNUpdateBlock(newBlockContentPos, { type: "paragraph", props: {} })
380380
.setTextSelection(newBlockContentPos)
381381
.run();
382+
} else {
383+
this.editor.commands.setTextSelection(endPos);
382384
}
383385

384386
// Focuses and activates the suggestion menu.

0 commit comments

Comments
 (0)