Skip to content

Commit

Permalink
📋 fix(handlePaste): Remove Custom rich-text handling (#3025)
Browse files Browse the repository at this point in the history
* fix: rich text edge case

* fix(useTextarea): removing custom handling fixes RTF slow loading, default behavior with form prefers plain-text
  • Loading branch information
danny-avila authored Jun 10, 2024
1 parent ef76cc1 commit 803fd63
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions client/src/hooks/Input/useTextarea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [];
Expand Down

0 comments on commit 803fd63

Please sign in to comment.