bmcmahen / react-image-enlarger

Simple medium.com style image zooming with gesture support
https://codesandbox.io/embed/adoring-sun-dz5yj
70 stars 6 forks source link

Wrong location of image if container has "transform" style #3

Open ebk46 opened 5 years ago

ebk46 commented 5 years ago

I'm using MaterialUI v4 and I'm trying to use react-image-enlarger inside of a modal. It looks like the location is incorrect as long as the modal has "transform" set.

Sandbox: https://codesandbox.io/s/react-image-enlarge-modal-bug-pviqp

In the sandbox you can comment/uncomment the transform to see how it is effecting the image placement.

bmcmahen commented 5 years ago

Hmm, interesting. Good catch. I'm not sure entirely what's going on as getBoundingClientRect should take into account transforms. I'll try and debug and get a solution to this soon.