From 803fd63121512867b3d1e43725c20b91d667557c Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Mon, 10 Jun 2024 14:36:51 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=8B=20fix(handlePaste):=20Remove=20Cus?= =?UTF-8?q?tom=20rich-text=20handling=20(#3025)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: rich text edge case * fix(useTextarea): removing custom handling fixes RTF slow loading, default behavior with form prefers plain-text --- client/src/hooks/Input/useTextarea.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/client/src/hooks/Input/useTextarea.ts b/client/src/hooks/Input/useTextarea.ts index 3b6c8b9cdd..569766784c 100644 --- a/client/src/hooks/Input/useTextarea.ts +++ b/client/src/hooks/Input/useTextarea.ts @@ -209,21 +209,6 @@ 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 || richText)) { - insertTextAtCursor(textAreaRef.current, includedText); - forceResize(textAreaRef); - } - if (e.clipboardData.files.length > 0) { setFilesLoading(true); const timestampedFiles: File[] = [];