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

There may be problems in some magnification situations. #205

Open
uyoungco opened this issue Nov 14, 2023 · 7 comments
Open

There may be problems in some magnification situations. #205

uyoungco opened this issue Nov 14, 2023 · 7 comments

Comments

@uyoungco
Copy link

Bug description

If the image is not fully displayed, it will also be incomplete after enlargement.

How to reproduce

Please check the error reproduction link.

Expected behavior

The page image display may be missing, and it should be a complete image after enlargement.

Reproducible example

Link to the bug reproduction

Environment

  • Browser: Chrome / 119.0.6045.123 Mac OS
  • medium-zoom version: 1.0.8
@jtiee
Copy link

jtiee commented Nov 22, 2023

When I visit your repro link, I see a huge image. When I click it, it "zooms" to show the entire image. So, I'm unable to reproduce the problem.

I've tried using the following browsers:

  • Chrome 119.0.6045.159
  • Firefox 120.0
  • Safari 17.1 (19616.2.9.11.7)

You should share a screenshot of the problem.

@uyoungco
Copy link
Author

I'm sorry, I have replaced the image enlargement plugin on the example webpage with something else.

This issue still exists, if the picture is not fully displayed, the image shown after using the magnifier will also be incomplete.

@jtiee
Copy link

jtiee commented Jan 2, 2024

What does "not fully displayed" mean? Outside the current viewport? Not yet fully loaded?

How can I build a repro case?

@uyoungco
Copy link
Author

uyoungco commented Jan 3, 2024

@jtiee
Copy link

jtiee commented Jan 4, 2024

Thanks for the repro case!

I see the problem. The Tailwind classes are applied to the <img> tags, and not to containers around the images. Since medium-zoom uses the <img> tag for the zoomed presentation, the Tailwind styles come along for the ride.

If you apply the styles to a container, you should get the full image upon zoom.

@uyoungco
Copy link
Author

uyoungco commented Jan 5, 2024

In most cases, the <img> tag will definitely be styled. So, do you have a good solution for this?

@jtiee
Copy link

jtiee commented Jan 5, 2024

If you style your images so they are cropped at regular size, I'm not sure why you'd expect medium-zoom to know how to remove the crop from images. Some folks might crop their images, as you do, and expect the crop to remain upon zoom.

You might consider:

  • Use your own event handling to call open or on. That would let you listen to the Promise<Zoom> (or open event) and appropriately manipulate the image styles in the Zoom container.

  • Use your own event handling to call attach. That would let you zoom to a normally hidden image with different styling than the normal-size image.

If you can't get those options to work, the only other thing I can suggest is to find/implement another zoom library.

FYI: I'm not a contributor to medium-zoom, I was trying to help as a very satisfied user of this library.

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

No branches or pull requests

2 participants