From 84a53cb7cfee53825ed29188e82a21950134d2c7 Mon Sep 17 00:00:00 2001 From: xuzuodong Date: Tue, 22 Oct 2024 18:16:31 +0800 Subject: [PATCH] chore: support sending message using numpad enter --- web/app/components/base/chat/chat/chat-input-area/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/components/base/chat/chat/chat-input-area/index.tsx b/web/app/components/base/chat/chat/chat-input-area/index.tsx index f1e72d255674a1..05aaaa6bc250aa 100644 --- a/web/app/components/base/chat/chat/chat-input-area/index.tsx +++ b/web/app/components/base/chat/chat/chat-input-area/index.tsx @@ -96,7 +96,7 @@ const ChatInputArea = ({ } const handleKeyUp = (e: React.KeyboardEvent) => { - if (e.code === 'Enter') { + if (e.key === 'Enter') { e.preventDefault() // prevent send message when using input method enter if (!e.shiftKey && !isUseInputMethod.current) @@ -106,7 +106,7 @@ const ChatInputArea = ({ const handleKeyDown = (e: React.KeyboardEvent) => { isUseInputMethod.current = e.nativeEvent.isComposing - if (e.code === 'Enter' && !e.shiftKey) { + if (e.key === 'Enter' && !e.shiftKey) { setQuery(query.replace(/\n$/, '')) e.preventDefault() }