fix: 发送消息后清空contenteditable内容
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
923a2288da
commit
7d3f97e972
@ -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]);
|
||||
|
||||
// 处理文件选择 - 上传后立即添加到画布
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user