diff --git a/src/components/Option/Playground/PlaygroundForm.tsx b/src/components/Option/Playground/PlaygroundForm.tsx index 274600e..cb2029a 100644 --- a/src/components/Option/Playground/PlaygroundForm.tsx +++ b/src/components/Option/Playground/PlaygroundForm.tsx @@ -14,6 +14,7 @@ import { useTranslation } from "react-i18next" import { KnowledgeSelect } from "../Knowledge/KnowledgeSelect" import { useSpeechRecognition } from "@/hooks/useSpeechRecognition" import { PiGlobe } from "react-icons/pi" +import { handleChatInputKeyDown } from "@/utils/key-down" type Props = { dropedFile: File | undefined @@ -144,13 +145,16 @@ export const PlaygroundForm = ({ dropedFile }: Props) => { }) const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === "Process" || e.key === "229") return + if (import.meta.env.BROWSER !== "firefox") { + if (e.key === "Process" || e.key === "229") return + } if ( - !typing && - e.key === "Enter" && - !e.shiftKey && - !isSending && - sendWhenEnter + handleChatInputKeyDown({ + e, + sendWhenEnter, + typing, + isSending + }) ) { e.preventDefault() stopListening() @@ -244,8 +248,16 @@ export const PlaygroundForm = ({ dropedFile }: Props) => { />