const tableToCopy = document.querySelector(â[class*=âflexContainer82â]â);
if (!tableToCopy) {
console.error(âElement not found!â);
return false;
}
const blob = await domtoimage.toBlob(tableToCopy);
// Create a new ClipboardItem with the Blob
const item = new ClipboardItem({
'image/png': blob
});
// Write the image to the clipboard
await navigator.clipboard.write([item]);
This code used to work before, after uibakery upgrade it doesnât anymore. The page hangs and it takes a very long time to respond back.
Can anyone help me how to copy an element to clipboard. The flexcontainer has both image and a table.