vre2h/use-react-screenshot

screenshot different from DOM

Closed this issue · 6 comments

The screenshot is adding some gray shadows (right and bottom) that are not in the DOM, is there a way to fix this?

Screen Shot 2021-12-06 at 17 43 34

Actually, this is related to html2canvas, so closing it

Hi @fcpauldiaz – did you figure out how to get rid of the shadows?

Hi @shiraleeana the shadows are an issue of the underlying library html2canvas. The workaround I'm using is disabling the shadows of the components only right before taking the screenshot and then re-enabling them after.

Ok I see. Thanks for that.

Found a solution for myself:
I just had a box shadow on my "card" which needed to be screenshot.
So I added an extra div inside the card and used that as the ref for the screenshot instead – no shadow issues.

The dropdown has to be outside of your reference