From 2d9f5ad41287af35011166caafc7846173209545 Mon Sep 17 00:00:00 2001 From: kseniyakuzina Date: Mon, 14 Oct 2024 07:33:18 +0300 Subject: [PATCH] fix(MarkdownEditorView): prevent the default preview shortcut behaviour --- src/bundle/MarkdownEditorView.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bundle/MarkdownEditorView.tsx b/src/bundle/MarkdownEditorView.tsx index 819048638..1d5eecfda 100644 --- a/src/bundle/MarkdownEditorView.tsx +++ b/src/bundle/MarkdownEditorView.tsx @@ -128,7 +128,10 @@ export const MarkdownEditorView = React.forwardRef canRenderPreview && isPreviewKeyDown(e), - () => onShowPreviewChange(!showPreview), + (e) => { + e.preventDefault(); + onShowPreviewChange(!showPreview); + }, {event: 'keydown'}, [showPreview, editorMode, onShowPreviewChange, canRenderPreview], );