浏览代码

feat: add `isComposing` check to function `handleKeyDown` in file `pages/side-panel/src/components/ChatInput.tsx`

yushengchen 4 月之前
父节点
当前提交
8821ecd023
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pages/side-panel/src/components/ChatInput.tsx

+ 1 - 1
pages/side-panel/src/components/ChatInput.tsx

@@ -62,7 +62,7 @@ export default function ChatInput({
 
 
   const handleKeyDown = useCallback(
   const handleKeyDown = useCallback(
     (e: React.KeyboardEvent) => {
     (e: React.KeyboardEvent) => {
-      if (e.key === 'Enter' && !e.shiftKey) {
+      if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {
         e.preventDefault();
         e.preventDefault();
         handleSubmit(e);
         handleSubmit(e);
       }
       }