Make WordPress Core

Opened 3 months ago

Closed 3 months ago

#64450 closed defect (bug) (reported-upstream)

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

Reported by: mehrazmorshed's profile mehrazmorshed Owned by:
Milestone: Priority: normal
Severity: major Version:
Component: General Keywords:
Focuses: Cc:

Description

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.

It generates 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

Attachments (1)

Screenshot at Dec 23 17-09-02.png (303.3 KB) - added by mehrazmorshed 3 months ago.

Download all attachments as: .zip

Change History (3)

#1 @mehrazmorshed
3 months ago

  • Summary changed from Image block “Enlarge on click” throws JS error and locks page scrolling on first load #74184 to Image block “Enlarge on click” throws JS error and locks page scrolling on first load

It looks like the error is coming from this WordPress core file:

/wp-includes/js/dist/script-modules/block-library/image/view.min.js

This file controls the Image block “Enlarge on click” feature.

#2 @Mamaduka
3 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

The bug was already reported in the correct directory - https://github.com/WordPress/gutenberg/issues/74184.

There's no need to create multiple issues/tickets.

Note: See TracTickets for help on using tickets.