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} />
)}