diff --git a/web/src/views/ApplicationConfig/components/AiPromptModal.tsx b/web/src/views/ApplicationConfig/components/AiPromptModal.tsx index 5491ad7a..1666e075 100644 --- a/web/src/views/ApplicationConfig/components/AiPromptModal.tsx +++ b/web/src/views/ApplicationConfig/components/AiPromptModal.tsx @@ -185,6 +185,7 @@ const AiPromptModal = forwardRef(({ handleOpen, })); const [isFocus, setIsFocus] = useState(false) + const [isComposing, setIsComposing] = useState(false) const handleFocus = () => { setIsFocus(true) } @@ -236,7 +237,9 @@ const AiPromptModal = forwardRef(({ setIsComposing(true)} + onCompositionEnd={() => setIsComposing(false)} + onKeyDown={(e) => { if (e.key === 'Enter' && !isComposing) handleSend() }} variant="borderless" className="rb:p-0!" onFocus={handleFocus} diff --git a/web/src/views/Prompt/index.tsx b/web/src/views/Prompt/index.tsx index 13c09042..0475b40a 100644 --- a/web/src/views/Prompt/index.tsx +++ b/web/src/views/Prompt/index.tsx @@ -169,6 +169,7 @@ const Prompt: FC = () => { updateSession() } const [isFocus, setIsFocus] = useState(false) + const [isComposing, setIsComposing] = useState(false) const handleFocus = () => { setIsFocus(true) } @@ -209,7 +210,9 @@ const Prompt: FC = () => { setIsComposing(true)} + onCompositionEnd={() => setIsComposing(false)} + onKeyDown={(e) => { if (e.key === 'Enter' && !isComposing) handleSend() }} variant="borderless" className="rb:p-0!" onFocus={handleFocus}