From ac033c5ec896f2049f265acf6716d9aece3a8240 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Wed, 23 Oct 2024 14:37:23 +0200 Subject: [PATCH] feat(Assistant): Add shift+enter support on desktop conversation bar --- src/assistant/Conversations/ConversationBar.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/assistant/Conversations/ConversationBar.jsx b/src/assistant/Conversations/ConversationBar.jsx index eb7222c129..69c4336b50 100644 --- a/src/assistant/Conversations/ConversationBar.jsx +++ b/src/assistant/Conversations/ConversationBar.jsx @@ -95,9 +95,15 @@ const ConversationBar = ({ assistantStatus }) => { ), onKeyDown: ev => { - if (!isMobile && ev.key === 'Enter') { - ev.preventDefault() // prevent form submit - handleClick() + if (!isMobile) { + if (ev.shiftKey && ev.key === 'Enter') { + return ev + } + + if (ev.key === 'Enter') { + ev.preventDefault() // prevent form submit + return handleClick() + } } } }