From b2f597ca45760444407280155f5eff74b939f54b Mon Sep 17 00:00:00 2001 From: Flavien David Date: Fri, 22 Dec 2023 16:02:54 +0100 Subject: [PATCH] Handle Shift + Enter // Fix autofocus on end --- .../conversation/input_bar/editor/useCustomEditor.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx b/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx index e05af415bc84..2f32d7f5086c 100644 --- a/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx +++ b/front/components/assistant/conversation/input_bar/editor/useCustomEditor.tsx @@ -149,7 +149,7 @@ const useCustomEditor = ({ const editor = useEditor( { - autofocus: true, + autofocus: "end", enableInputRules: false, // Disable Markdown when typing. enablePasteRules: false, // Disable Markdown when pasting. extensions: [ @@ -179,7 +179,7 @@ const useCustomEditor = ({ class: "border-0 outline-none overflow-y-auto h-full", }, handleKeyDown: (view, event) => { - if (event.key === "Enter") { + if (event.key === "Enter" && !event.shiftKey) { // Prevent the default Enter key behavior event.preventDefault();