Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zoom.in function sets an unexpected translate3d value to the .swiper-zoom-container #7903

Open
6 tasks done
m-kawafuji opened this issue Feb 21, 2025 · 0 comments · May be fixed by #7904
Open
6 tasks done

zoom.in function sets an unexpected translate3d value to the .swiper-zoom-container #7903

m-kawafuji opened this issue Feb 21, 2025 · 0 comments · May be fixed by #7904

Comments

@m-kawafuji
Copy link

m-kawafuji commented Feb 21, 2025

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-zoom-forked-w4jlgg

Bug description

zoom.in function sets an unexpected transform3d value to the .swiper-zoom-container element, if the previous scale value is greater than 1 and the position of the image is not centered.

Expected Behavior

The origin of the image should be preserved after zoom.in function is called, as if transform-origin was center;

Actual Behavior

Reproduction

  1. Click the "zoom in" button once.
  2. Drag the image randomly to locate it out of the center.
  3. Click the "zoom in" button again.
  4. zoom.in function sets the position unexpectedly. The origin is not centered.
zoom-in.mp4

Swiper version

11.2.4

Platform/Target and Browser Versions

Chrome, Safari, Firefox

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • 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
@m-kawafuji m-kawafuji linked a pull request Feb 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant