Skip to content

Image block “Enlarge on click” throws JS error and locks page scrolling on first load #74184

@mehrazmorshed

Description

@mehrazmorshed

When using the Image block with “Enlarge on click” enabled, the page becomes unscrollable after closing the lightbox, but only on the first page load. After a browser reload, the issue no longer occurs.

I investigated this myself and found a JavaScript console error coming from WordPress core, which prevents the scroll-unlock logic from running.

Steps to Reproduce

  1. Open a page with large images using the Image block
  2. Ensure “Enlarge on click” is enabled
  3. Scroll down the page
  4. Click an image to open it in the lightbox
  5. Close the image
  6. Try to scroll the page

Issue Source: https://wordpress.org/support/topic/enlarge-on-click-page-scroll-issue/

Screenshot:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] ImageAffects the Image Block[Status] Needs More InfoFollow-up required in order to be actionable.[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