Skip to content

fix: fix transform origin of zoom.in() function #7904

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

Merged

Conversation

m-kawafuji
Copy link
Contributor

@m-kawafuji m-kawafuji commented Feb 21, 2025

This PR fixes #7903

  • 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.
  • The origin of the image should be preserved after zoom.in function is called, as if transform-origin was center;

Reproduction

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

zoom-in.mp4

This PR

This PR fixes the issue.

zoom-in-pr.mp4

`zoom.in()` function sets an unexpected `transform3d()` value to the
`.swiper-zoom-container` element.
@nolimits4web
Copy link
Owner

t0ggles-create swiper

Copy link

t0ggles bot commented Feb 26, 2025

Task nolimits4web/SWIPER-159 was created

t0ggles task SWIPER-159

@t0ggles t0ggles bot added the t0ggles Linked to the t0ggles task label Feb 26, 2025
@nolimits4web nolimits4web merged commit f7febe1 into nolimits4web:master Mar 3, 2025
3 checks passed
Copy link

t0ggles bot commented Mar 3, 2025

Task nolimits4web/SWIPER-159 status changed to Done

@nolimits4web
Copy link
Owner

Merged, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t0ggles Linked to the t0ggles task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zoom.in function sets an unexpected translate3d value to the .swiper-zoom-container
2 participants