From 6f66da4d5e5015cd325f0cf3ea2fd719e5c7dd87 Mon Sep 17 00:00:00 2001 From: wangzhichao <570738205@qq.com> Date: Tue, 28 May 2024 17:34:43 +0800 Subject: [PATCH] fix: Fix the problem of multiple line breaks in Q&A (#1573) --- web/components/common/completion-input.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/components/common/completion-input.tsx b/web/components/common/completion-input.tsx index 3b40006ba..23bdcbc78 100644 --- a/web/components/common/completion-input.tsx +++ b/web/components/common/completion-input.tsx @@ -60,6 +60,7 @@ function CompletionInput({ children, loading, onSubmit, handleFinish, ...props } if (!userInput.trim()) return; if (e.keyCode === 13) { if (e.shiftKey) { + e.preventDefault() setUserInput((state) => state + '\n'); return; }