Skip to content

Image block: The page is prevented from scrolling after the lightbox is closed if the image wasn't ready before the lightbox was clicked open #74685

@oglekler

Description

@oglekler

Description

After opening and closing the Lightbox of the Image block, the page is stuck when the image for the Lightbox is not loaded in time. If the image is already loaded and opens immediately, this is not happening.

Step-by-step reproduction instructions

  1. Open Developer Tools in a browser
  2. Go to: https://asia.wordcamp.org/2026/contributor-day/
  3. Click on an image in the post.
  4. Nothing is happening for a long time - image is loading.
  5. The image is opened.
  6. Click to close the image.
  7. Try to scroll the page—it resists and returns to the place when the lightbox was.
  8. Try to open and close the lightbox several times.
  9. Go to the Network tab and notice that the image was requested multiple times.

Screenshots, screen recording, code snippet

Image Image

Environment info

WordPress 6.9.1-alpha-61393
Gutenberg 22.3.0
Twenty Twenty-Four 1.3 theme

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] ImageAffects the Image Block[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions