react-awesome-lightbox icon indicating copy to clipboard operation
react-awesome-lightbox copied to clipboard

Image jumps when you start dragging

Open pi-kei opened this issue 3 years ago • 5 comments

Steps to reproduce:

  1. You need 2 images
  2. Select the first one, zoom in and drag it out of center and leave it there
  3. Select the second one, zoom in and start dragging
  4. Your image jumps

I guess when you end dragging you have to reset initX, initY or lastX, lastY or both. I'm not sure about that.

pi-kei avatar May 19 '21 10:05 pi-kei

Sorry for the late followup, could you share the device details?

theanam avatar Aug 21 '21 14:08 theanam

Sorry for the late followup, could you share the device details?

Latest desktop version of Chrome.

pi-kei avatar Aug 21 '21 16:08 pi-kei

Here is a GIF XAoJg1m3qu

pi-kei avatar Aug 21 '21 16:08 pi-kei

Its the same when u have one only image, I think the reset button does not fully reset previous position, so when u click 2nd image, the position start again at the previous one. I looked few minutes your code, its pretty cool ^^ You may need to reset lastX and lastY in your navigateImage and resetZoom methods.

mathieu-nomadeec avatar Aug 23 '21 15:08 mathieu-nomadeec

I did a Pull Request to fix this issue

mathieu-nomadeec avatar Aug 24 '21 08:08 mathieu-nomadeec