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

Image block: Delayed response when opening image in lightbox for the first time #51555

Closed
artemiomorales opened this issue Jun 15, 2023 · 6 comments
Labels
[Block] Image Affects the Image Block [Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Bug An existing feature does not function as intended

Comments

@artemiomorales
Copy link
Contributor

artemiomorales commented Jun 15, 2023

Description

When opening an image in the lightbox, there is a delay before the UI responds.

Step-by-step reproduction instructions

Must be tested on a live (not local) environment.

  1. Ensure the Gutenberg Interactivity API experiments are enabled.
  2. Add an image to a post.
  3. Enable the lightbox for the images in Advanced > Behaviors under the block settings.
  4. Publish the post and click on the image.
  5. See that there is a delay before the lightbox animation takes effect.

Screenshots, screen recording, code snippet

lightbox-delay.mp4

Environment info

-Gutenberg 16.0.0, WP 6.2.2

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@artemiomorales artemiomorales added [Type] Bug An existing feature does not function as intended [Block] Image Affects the Image Block [Feature] Interactivity API API to add frontend interactivity to blocks. labels Jun 15, 2023
@luisherranz
Copy link
Member

Why is the delay happening? Is it because it waits until the image has been downloaded?

@artemiomorales
Copy link
Contributor Author

Why is the delay happening? Is it because it waits until the image has been downloaded?

@luisherranz Yes, it's because it waits for the image to be downloaded.

@artemiomorales
Copy link
Contributor Author

Note: While we are considering overall lightbox animation improvements, we could include this suggestion as part of the same PR.

I also wonder if you all considered a very slight zoom on hover so it’d anticipate the behavior.

@luisherranz
Copy link
Member

Is it possible to use the original image first, then switch to the full version once it's downloaded?

@artemiomorales
Copy link
Contributor Author

@luisherranz Will give that a shot! I'll also look into preloading the image on hover, which could at least help on desktop.

@artemiomorales
Copy link
Contributor Author

artemiomorales commented Jun 26, 2023

This has been fixed in #51721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants