Skip to content

Commit

Permalink
fix copy image - set width/height
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen authored and Amy Chen committed Mar 14, 2024
1 parent 9f44d58 commit 25acc50
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/components/report/CopyPaste.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,17 @@ export default class CopyPaste extends Component {
}

copyContentImage() {
copyDomToClipboard(this.contentAreaRef.current, {
// beforeCopy: () => (this.containerRef.current.style.height = "498px"),
// afterCopy: () =>
// (this.containerRef.current.style.height = "calc(100vh - 174px)"),
const scoreSummaryContent = this.getScoreSummaryContent();
const tempNode = document.createElement("textarea");
tempNode.setAttribute("readonly", true);
tempNode.style.height = "300px";
tempNode.style.width = "784px";
tempNode.style.borderWidth = 0;
tempNode.value = scoreSummaryContent;
document.querySelector("body").appendChild(tempNode);

copyDomToClipboard(tempNode, {
afterCopy: () => tempNode.remove()
});
}

Expand Down

0 comments on commit 25acc50

Please sign in to comment.