francoischalifour / medium-zoom

🔎🖼 A JavaScript library for zooming images like Medium
https://medium-zoom.francoischalifour.com
MIT License
3.58k stars 161 forks source link

fix: ensure zooming out doesn't happen #176

Closed paazca closed 1 year ago

paazca commented 2 years ago

Attempt at fixing #177 In some cases, pressing an image makes it zoom out.

Gif of the issue: image

With these proposed changes, images will only zoom out if they're bigger than the viewport.

codesandbox-ci[bot] commented 2 years ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d7bf709723955e58bf9244bb5cea1afe78c1ca44:

Sandbox Source
@medium-zoom/vanilla-example Configuration
francoischalifour commented 2 years ago

Thanks for the PR @paazca, I'll review it in the next few days!

tobimori commented 2 years ago

@francoischalifour When can you review this? I tried it and it fixed the issue for me.

francoischalifour commented 2 years ago

@paazca Any chance you also add a test for this?

transitive-bullshit commented 2 years ago

I've been running into this as well; fix looks solid (same as what I did locally).

ImTheDeveloper commented 2 years ago

Any chance of this getting merged?

francoischalifour commented 1 year ago

🎉 This fix was released in v1.0.7.

transitive-bullshit commented 1 year ago

Thanks @francoischalifour & @paazca 🙏 😄 🙏