fix: 发送消息后清空contenteditable内容
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Your Name 2026-02-01 17:43:27 +08:00
parent 923a2288da
commit 7d3f97e972

View File

@ -529,8 +529,15 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
parts: parts,
});
// 清空状态
setInput("");
setAttachments([]);
// 🆕 清空 contenteditable div 的内容
const editableDiv = textareaRef.current as HTMLDivElement | null;
if (editableDiv && editableDiv.isContentEditable) {
editableDiv.innerHTML = '';
}
}, [input, attachments, selectedModelId, sendMessage, getRecentImageUrls]);
// 处理文件选择 - 上传后立即添加到画布