copying an element to clipboard

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.

Hi @userportfolio

We will have a look.

Hi @userportfolio

Could you please provide a bit more detail:

  • What content is loaded in the frame when it breaks?

  • Are there any errors visible at that moment?

  • Any additional information or context you can share about the situation would also be very helpful.