Closed HellowVirgil closed 1 month ago
can use like this:
copyToClipboard(url, {
format: 'text/plain',
onCopy: clipboardData => {
(clipboardData as DataTransfer | null)?.setData(
'text/html',
`<a href="${url}">aaa</a>`,
);
},
});
In this case, only
text/html
format can be set to clipboard, and when we paste to a plain textarea it will be null:because the clipboardData has been cleaned when called each time.
So we should only clear the current format when set data.