Fix Clipboard Fallback by Checking textArea.select Return Value - #8880
Fix Clipboard Fallback by Checking textArea.select Return Value#8880tmdeveloper007 wants to merge 1 commit into
Conversation
|
This pull request improves the clipboard fallback handling by checking the return value of |
Aamod007
left a comment
There was a problem hiding this comment.
I appreciate you looking into improving the clipboard fallback in \utils/clipboard.ts. However, I have a concern with the changes: the .select()\ method on \HTMLTextAreaElement\ returns \�oid\ (undefined), not a boolean indicating success. Because of this, \const selected = textArea.select(); if (!selected) return false;\ will always evaluate to false and the function will never reach \execCommand('copy'). Please double-check the MDN documentation for \HTMLTextAreaElement.select()\ and revise this approach. I'll have to request changes for now.
Summary of What Has Been Done
Modified
fallbackCopyToClipboardto check the return value oftextArea.select(). Returnsfalseimmediately if selection fails.Changes Made
utils/clipboard.ts: ChecktextArea.select()return value; returnfalseearly if selection failsImpact it Made
Closes #8848
Note: Please assign this PR to the
tmdeveloper007account.