From 4fc1101c79d45992fa94b12924ae330c60e1c1c3 Mon Sep 17 00:00:00 2001 From: Olaf Sulich Date: Thu, 16 Jan 2025 10:07:30 +0100 Subject: [PATCH] fix(BlockquotePlugin): block sending a message (#18592) --- .../plugins/BlockquotePlugin/BlockquotePlugin.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/script/components/InputBar/components/RichTextEditor/plugins/BlockquotePlugin/BlockquotePlugin.tsx b/src/script/components/InputBar/components/RichTextEditor/plugins/BlockquotePlugin/BlockquotePlugin.tsx index 1484594d9aa..188d422b1ed 100644 --- a/src/script/components/InputBar/components/RichTextEditor/plugins/BlockquotePlugin/BlockquotePlugin.tsx +++ b/src/script/components/InputBar/components/RichTextEditor/plugins/BlockquotePlugin/BlockquotePlugin.tsx @@ -73,13 +73,15 @@ const registerBlockquoteEnterCommand = (editor: LexicalEditor) => { return false; } + if (!event.shiftKey) { + return false; + } + event.preventDefault(); - if (event.shiftKey) { - editor.update(() => { - editor.dispatchCommand(INSERT_LINE_BREAK_COMMAND, false); - }); - } + editor.update(() => { + editor.dispatchCommand(INSERT_LINE_BREAK_COMMAND, false); + }); return true; },