Skip to content

Commit

Permalink
Ensure the print iframe doesn't overlap the page (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewHerbst authored Nov 17, 2022
1 parent 1ed74f8 commit 643919d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ export default class ReactToPrint extends React.Component<IReactToPrintProps> {
printWindow.width = `${document.documentElement.clientWidth}px`;
printWindow.height = `${document.documentElement.clientHeight}px`;
printWindow.style.position = "absolute";
printWindow.style.top = "-1000px";
printWindow.style.left = "-1000px";
printWindow.style.top = `-${document.documentElement.clientHeight + 100}px`;
printWindow.style.left = `-${document.documentElement.clientWidth + 100}px`;
printWindow.id = "printWindow";
// Ensure we set a DOCTYPE on the iframe's document
// https://github.com/gregnb/react-to-print/issues/459
Expand Down

0 comments on commit 643919d

Please sign in to comment.