📋 fix(handlePaste): Remove Custom rich-text handling (#3025)

* fix: rich text edge case

* fix(useTextarea): removing custom handling fixes RTF slow loading, default behavior with form prefers plain-text
This commit is contained in:
Danny Avila 2024-06-10 14:36:51 -04:00 committed by GitHub
parent ef76cc195e
commit 803fd63121
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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[] = [];