Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

✍️ fix(useTextarea): Rich Text Format paste from MS Word (#2530)

Danny Avila41218181246c
diff --git a/client/src/hooks/Input/useTextarea.ts b/client/src/hooks/Input/useTextarea.ts
index 4f8e6f7a93..0edc8be060 100644
--- a/client/src/hooks/Input/useTextarea.ts
+++ b/client/src/hooks/Input/useTextarea.ts
@@ -180,15 +180,17 @@ export default function useTextarea({
return;
}
+ let richText = '';
let includedText = '';
const { types } = e.clipboardData;
if (types.indexOf('text/rtf') !== -1 || types.indexOf('Files') !== -1) {
e.preventDefault();
includedText = e.clipboardData.getData('text/plain');
+ richText = e.clipboardData.getData('text/rtf');
}
- if (includedText && e.clipboardData.files.length > 0) {
+ if (includedText && (e.clipboardData.files.length > 0 || richText)) {
insertTextAtCursor(textAreaRef.current, includedText);
forceResize(textAreaRef);
}