tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.21k stars 1.68k forks source link

NOT WORKING - Library is not working in latest chrome with display GRID #410

Open rashidaghadiinfotech opened 2 years ago

rashidaghadiinfotech commented 2 years ago

Hello there,

I am using this library from couple of years and this was working fine. Before couple of days, chrome released latest version and suddenly capturing area stopped working.

` clearInterval($preview_iframe); var node = document.getElementById('diagram-container-wrapper');

domtoimage.toPng(node) .then(function (dataUrl) { var img = new Image(); img.src = dataUrl; document.body.appendChild(img); }) .catch(function (error) { console.error('oops, something went wrong!', error); });`

try to place this code in console and you will see how badly image is getting broken. Can anyone look in this matter and guide me what is wrong here?

#overall-container div has display grid. and seems that is causing issue.

Thanks.

pawelkrystkiewicz commented 2 years ago

I have the same problem with html-to-image and react-component-export-image. I am also using CSS grid.

frebern commented 2 years ago

I have same trouble too. I found that the 'grid-area' property causing this issue.

And It starts from chromium 99.0.4820.0. (R957400)

rashidaghadiinfotech commented 2 years ago

@frebern @pawelkrystkiewicz @pbakaus @ulikoehler Guys, you guys found any solution on this?

pawelkrystkiewicz commented 2 years ago

@rashidaghadiinfotech I switched to flex because it was feasible for my case. Here is the chromium ticket: https://bugs.chromium.org/p/chromium/issues/detail?id=1305997

mell0kat commented 2 years ago

I am planning to switch to flex but this is not at all ideal. Hoping for a fix soon.

MSCAU commented 2 years ago

I gather it will be fixed in Chrome 101, which is due in April: https://chromestatus.com/features/schedule

Not surprisingly, it also affects Edge 99, BTW. Firefox and Safari seem to work fine.

mustafa-soylemez commented 2 years ago

Are there any news from bug-fix, I'm still having same issue...