Pārlūkot izejas kodu

Web app support sending message using numpad enter (#9659)

Hash Brown 6 mēneši atpakaļ
vecāks
revīzija
6827c4038b

+ 2 - 2
web/app/components/base/chat/chat/chat-input-area/index.tsx

@@ -96,7 +96,7 @@ const ChatInputArea = ({
   }
 
   const handleKeyUp = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
-    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<HTMLTextAreaElement>) => {
     isUseInputMethod.current = e.nativeEvent.isComposing
-    if (e.code === 'Enter' && !e.shiftKey) {
+    if (e.key === 'Enter' && !e.shiftKey) {
       setQuery(query.replace(/\n$/, ''))
       e.preventDefault()
     }