swiper icon indicating copy to clipboard operation
swiper copied to clipboard

Intermittent Displacement Issue During Image Zoom: Sudden Shift Sideways During Pinch-to-Zoom on Mobile Devices

Open SerhiiStepanenko opened this issue 1 year ago • 2 comments

Check that this is really a bug

  • [X] I confirm

Reproduction link

https://codesandbox.io/p/sandbox/eager-leakey-3tll5r?file=%2Fsrc%2FModalSlider.js%3A16%2C21

Bug description

When attempting to zoom in on an image using the pinch-to-zoom gesture with two fingers on a mobile device, the image initially zooms smoothly. However, at a certain point during the zoom, despite the gesture continuing smoothly, the image suddenly and sharply shifts to the side. This displacement seems random and unpredictable, causing issues with precision in image scaling control.

https://github.com/nolimits4web/swiper/assets/58136678/53362708-bad1-42e6-9000-3100cf58fc78

Expected Behavior

It is expected that the image will smoothly increase in size according to the user's finger movements, without any sudden or unexpected shifts to any side. The pinch-to-zoom gesture should provide stable and predictable scaling, allowing the user to precisely control the zoom level of the image.

Actual Behavior

Currently, while zooming in on an image using a two-finger pinch gesture, the image enlarges smoothly until, at a certain moment, it experiences a sharp and unexpected shift to the side. This shift occurs without any apparent reason, disrupting the expected smoothness and precision of zoom control. This behavior is observed across various mobile devices and represents a significant deviation from the expected user experience.

Swiper version

11.1.1

Platform/Target and Browser Versions

iOS, Safari

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • [X] Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • [ ] I'm willing to open a PR

SerhiiStepanenko avatar Apr 10 '24 15:04 SerhiiStepanenko

t0ggles-create swiper

nolimits4web avatar Apr 25 '24 08:04 nolimits4web

Task nolimits4web/SWIPER-95 was created

t0ggles task SWIPER-95

t0ggles[bot] avatar Apr 25 '24 08:04 t0ggles[bot]

Fixed by https://github.com/nolimits4web/swiper/commit/f67308c8f4367817d9c60980276c922af9fcb654

nolimits4web avatar May 30 '24 09:05 nolimits4web

Task nolimits4web/SWIPER-95 status changed to Done

t0ggles[bot] avatar May 30 '24 09:05 t0ggles[bot]