html2canvas promise returned before render complete
See original GitHub issuePlease make sure you are testing with the latest release of html2canvas. Old versions are not supported and issues reported for them will be closed.
Please follow the general troubleshooting steps first:
- You are using the latest version
- You are testing using the non-minified version of html2canvas and checked any potential issues reported in the console
Bug reports:
I have a page with several divs. Each of these divs has several react-table elements. I want to take a screenshot of each div and then create a zip file and download all of them at once (as a sort of pseudo powerpoint slide deck). This works perfectly on Mac, however when I’m using Google Chrome on Windows, the divs with several react tables seem to not finish rendering when the screenshot is taken. I’ve confirmed by turning on logging that the render completes in ~1000ms, but the canvas
that html2canvas returns appears as though it didn’t finish rendering. The react-tables are rendered, but the rest of the text on the page is somewhat transparent, as if it was halfway finished loading.
I don’t have a jsfiddle repro quite yet, but I’ll work on that to get one added here.
Specifications:
- html2canvas version tested with:
- Browser & version: latest Chrome - 77.0.3865.90
- Operating system: Windows (important, can’t reproduce on a Mac)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:5
Top GitHub Comments
I have been able to get this to work, though it’s not optimal.
I came to the 400ms timeout through trial and error. Anything less, and I observed the issue with the div not being completely rendered when html2canvas takes the screenshot.
I also ran into this issue and it caused a pretty bad bug on our end. Would like fixed!