From dbf30e441e05bcf85e0b0c06bd708e2e4013234a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Sun, 7 Sep 2025 00:18:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86=20=E4=B8=AD=E6=96=87=E8=BE=93=E5=85=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ChatInputBox/ChatInputBox.tsx | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/components/ChatInputBox/ChatInputBox.tsx b/components/ChatInputBox/ChatInputBox.tsx index a0113b7..7d18121 100644 --- a/components/ChatInputBox/ChatInputBox.tsx +++ b/components/ChatInputBox/ChatInputBox.tsx @@ -796,29 +796,20 @@ const RenderTemplateStoryMode = ({
{ - const value = e.target.value; - // 限制输入长度为500字符 - if (value.length > 500) { - return; - } - // 立即更新UI显示 - if (!selectedTemplate?.freeInputItem) return; - const updatedTemplate: StoryTemplateEntity = { - ...selectedTemplate, + // 更新自由输入文字字段 + const updatedTemplate = { + ...selectedTemplate!, freeInputItem: { - ...selectedTemplate.freeInputItem, - free_input_text: value + ...selectedTemplate!.freeInputItem, + free_input_text: e.target.value } }; - setSelectedTemplate(updatedTemplate); - // 使用防抖函数处理实际的状态更新 - debouncedUpdateInput(value); + setSelectedTemplate(updatedTemplate as StoryTemplateEntity); }} - maxLength={500} />
)}