msyavuz commented on code in PR #34233:
URL: https://github.com/apache/superset/pull/34233#discussion_r2222537776


##########
superset-frontend/src/utils/downloadAsImage.ts:
##########
@@ -71,18 +156,35 @@ export default function downloadAsImage(
     };
 
     return domToImage
-      .toJpeg(elementToPrint, {
+      .toJpeg(clonedElement, {
         bgcolor: theme?.colors.grayscale.light4,
         filter,
+        quality: 0.95,
+        height: clonedElement.scrollHeight,
+        width: clonedElement.scrollWidth,
       })
       .then((dataUrl: string) => {
+        // Clean up the cloned element
+        const tempContainer = clonedElement.parentElement;
+        if (tempContainer && tempContainer.parentElement) {
+          tempContainer.parentElement.removeChild(tempContainer);
+        }

Review Comment:
   can we return this as a function from `createEnhancedClone` function to both 
reduce code duplication and remove the possibility of someone using that 
without a cleanup?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to