You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then, when the initial zoom scale is set to 1, the first call of zoom.in with a custom ratio, zooms to the center of the photo
the second call of zoom.in with a custom ratio zooms to the position of the last click, which causes the position to jump, because the previous call zooms to different position
Check that this is really a bug
Reproduction link
https://codesandbox.io/p/sandbox/swiper-zoom-forked-87sdhv
Bug description
The bug is caused by these lines:
swiper/src/modules/zoom/zoom.mjs
Lines 474 to 477 in fc308b3
Swiper only zooms to the center of photo if currentScale === 1. Instead, swiper should clear image.touchesStart after currentScale is set to 1.
I couldn't reproduce the bug without calling zoom.in before clicking on the photo, not sure why.
Expected Behavior
zoom.in should zoom to the same spot as the previous call
Actual Behavior
The second call of zoom.in zooms to the position of the last click/touch.
Swiper version
11.0.6
Platform/Target and Browser Versions
macOS Firefox 122.0
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: