From 29ff62009fad7f608992dce27d69b8c75a04cb98 Mon Sep 17 00:00:00 2001 From: Md Saban <45597394+mdsaban@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:02:55 +0530 Subject: [PATCH] fix: markdown shortcuts removes existing block (#336) --- packages/core/editor/src/extensions/shortcuts.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/editor/src/extensions/shortcuts.tsx b/packages/core/editor/src/extensions/shortcuts.tsx index 40fc3a6c5..13d069708 100644 --- a/packages/core/editor/src/extensions/shortcuts.tsx +++ b/packages/core/editor/src/extensions/shortcuts.tsx @@ -38,6 +38,7 @@ export const withShortcuts = (editor: YooEditor, slate: SlateEditor) => { if (hasMatchedBlock && !matchedBlock.isActive()) { Transforms.select(slate, range); Transforms.delete(slate); + editor.blocks[matchedBlock.type].toggle({ focus: true }); Blocks.createBlock(editor, matchedBlock.type, { deleteText: false, focus: true }); return; }