bubkoo / html-to-image

✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
MIT License
5.39k stars 503 forks source link

Fixed elements not respected #460

Open zakpucci opened 3 months ago

zakpucci commented 3 months ago

Using a fixed position node as the HTMLElement outputs a blob or data URL as expected. That same blob or data URL converted to a file is blank every time. If the browser is dragged to the size of the HTMLElement in question, it exports correctly.

Expected Behavior

Whichever specific node is used as the HTMLElement, would be respected no matter it's position in the dom.

Current Behavior

Fixed position HTMLElement ignored, instead, the package attempts to use the entire, it seems.

Steps To Reproduce

1.) Position an HTMLElement fixed, try to use this package to export it properly. 2.) Thats it.

Additional Context

If the browser is dragged to the size of the HTMLElement in question, it exports correctly, see image 1 where I dragged it halfway to show the cutoff. See image 2 to show the typical export on a fixed element.

Image 1: Justin Brown - Quick Look (2) Image 2: Justin Brown - Quick Look (47)

Your Environment

vivcat[bot] commented 3 months ago

👋 @zakpucci

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.