From f8ddfbaaa3745ad203700db19417bb59f74350ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Mon, 8 Jul 2024 12:13:08 +0200 Subject: [PATCH] Add ability to not use live markdown on paste logic --- src/MarkdownTextInput.web.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MarkdownTextInput.web.tsx b/src/MarkdownTextInput.web.tsx index 801eb0cd..8c3d6924 100644 --- a/src/MarkdownTextInput.web.tsx +++ b/src/MarkdownTextInput.web.tsx @@ -521,8 +521,11 @@ const MarkdownTextInput = React.forwardRef( const handlePaste = useCallback((e) => { pasteRef.current = true; - e.preventDefault(); + if (e.isDefaultPrevented()) { + return; + } + e.preventDefault(); const clipboardData = e.clipboardData; const text = clipboardData.getData('text/plain'); document.execCommand('insertText', false, text);