-
Notifications
You must be signed in to change notification settings - Fork 36
Re-animate elements on lightbox open #2741
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
base: development
Are you sure you want to change the base?
Conversation
Bundle Size Diff
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates the animations frontend runtime to re-trigger Otter animations when a WordPress “Enlarge on click” lightbox is opened, addressing a compatibility issue where animated images/galleries can appear invisible in the lightbox.
Changes:
- Adds a lightbox container click listener to re-run
animateElements()when the WP lightbox is interacted with.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const lightboxes = document.querySelectorAll('.wp-lightbox-container'); | ||
| lightboxes.forEach((container) => { | ||
| container.addEventListener('click', () => { | ||
| animateElements(); | ||
| }); | ||
| }); |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting in this new block doesn’t match the surrounding file’s spacing conventions (e.g., window.addEventListener( 'load', … )). Please align with the existing style (spaces inside parentheses, consistent indentation) to keep the file consistent.
| // Re-animate elements when a lightbox is opened, as the content might be different. | ||
| const lightboxes = document.querySelectorAll('.wp-lightbox-container'); | ||
| lightboxes.forEach((container) => { | ||
| container.addEventListener('click', () => { | ||
| animateElements(); | ||
| }); |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change adds/changes frontend behavior for animations when the WordPress lightbox opens, but there’s no automated coverage to prevent regressions. Since the repo already has Playwright E2E coverage for animations, please add an E2E that applies an Otter animation to a core Image/Gallery block with “Enlarge on click” enabled and asserts the media is visible when the lightbox opens (and ideally after closing/reopening).
|
Plugin build for f0e644e is ready 🛎️!
|
Closes #2736
Summary
Re-animated the image or gallery block when WP Enlarge is open.
Checklist before the final review