-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
amp-lightbox-gallery - unexpected behavior with thumbnails #35402
Comments
@kristoferbaxter @caroqliu |
Adding @caroqliu to the issue. We might want to map this over to @alanorozco instead though. |
What you can do for nowAs a bandaid fix, I would recommend importing One downside of this approach is that this will cause (As a side note: I wonder if the above errors could be related to #30616, so linking that issue as well.) Investigation notesAs far as this issue goes, it looks like the carousel is being detached and re-attached by the lightbox gallery somehow. The rough flow of logic is:
(3) Carousel is detached from the dom and resets its internal slide value:
(4) Carousel is re-attached to the dom, and lays out to the first slide by default: amphtml/extensions/amp-carousel/0.1/slidescroll.js Lines 366 to 368 in f9df1c0
I think our best bet for resolving this issue is eliminating 3 & 4. The reason the amphtml/extensions/amp-carousel/0.2/amp-carousel.js Lines 248 to 251 in f9df1c0
amphtml/extensions/amp-base-carousel/0.1/child-layout-manager.js Lines 432 to 440 in f9df1c0
Two additional options that would prevent this problem from occurring without solving it at its root:
I'll dig further into why the carousel is being detached and update this issue accordingly. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Description
When you click a thumbnail to open an amp-lightbox-gallery, the first image in the gallery will show up, rather then the image associated with the clicked thumbnail.
Note that this was something we only recently discovered on one of our sites using amp-lightbox-gallery, and all our sites using amp-lightbox-galleries are affected.
This was discovered by a team member on the 21st of july, and have not been a problem in the past.
This issue is only present in v0.1 of the component, and seems to be fixed in v1.0
Reproduction Steps
https://amp.dev/documentation/examples/e-commerce/hotel/preview/?format=websites
This is reproduceable in the hotel demo on amp.dev
if you click any image, it will scale up, and then switch to the first image in the gallery.
Relevant Logs
No response
Browser(s) Affected
Chrome, Firefox, Safari, Edge
OS(s) Affected
No response
Device(s) Affected
No response
AMP Version Affected
No response
The text was updated successfully, but these errors were encountered: