From 5a9c63a776fd2a17352b39478f52754b4e9a42c2 Mon Sep 17 00:00:00 2001 From: zhhanging <39266588+zhhanging@users.noreply.github.com> Date: Tue, 9 Apr 2024 22:50:15 +0800 Subject: [PATCH] handle enter key in cjk input method (#2657) Co-authored-by: zhhanging --- web/screens/Chat/ChatInput/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/screens/Chat/ChatInput/index.tsx b/web/screens/Chat/ChatInput/index.tsx index 3dd53e01ee..9c54c8c895 100644 --- a/web/screens/Chat/ChatInput/index.tsx +++ b/web/screens/Chat/ChatInput/index.tsx @@ -99,7 +99,7 @@ const ChatInput: React.FC = () => { }, [currentPrompt]) const onKeyDown = async (e: React.KeyboardEvent) => { - if (e.key === 'Enter' && !e.shiftKey) { + if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) { e.preventDefault() if (messages[messages.length - 1]?.status !== MessageStatus.Pending) sendChatMessage(currentPrompt)