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

Cannot close overlay before opened event has fired. #196

Open
foxacid opened this issue Feb 15, 2023 · 3 comments
Open

Cannot close overlay before opened event has fired. #196

foxacid opened this issue Feb 15, 2023 · 3 comments

Comments

@foxacid
Copy link

foxacid commented Feb 15, 2023

On slow connections, when starting a zoom, the overlay cannot be closed until the images has loaded (opened event has fired). This may result in a user experience where the page seems broken as the overlay blocks all interaction and cannot be closed manually. Additionally the close method only seems to work once the zoom animation has finished (opened event has fired).

I'd expect to be able to close the overlay via click right after initiating the zoom animation (open event).

@foxacid
Copy link
Author

foxacid commented Feb 15, 2023

I just realised that the problem is related to my usage of lazySizes and automatic srcset size detection...

@francoischalifour
Copy link
Owner

Medium Zoom needs to load the target image before zooming, it's probably why it doesn't play well with lazysizes.

Can you please provide a reproduction?

@foxacid
Copy link
Author

foxacid commented Feb 16, 2023

Thank you for the quick reply.

Here's a reproduction:
https://codesandbox.io/s/medium-zoom-x-lazysizes-5mjkdd?file=/index.html

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