Skip to content

Conversation

@Sourav61
Copy link
Contributor

Fixed the image lightbox showing original image issue in synced pattern with overridden image

What?

Closes #64716

Why?

Previously, when opening the image lightbox, the image displayed was inconsistent—sometimes showing the original image instead of the expected overridden version. This issue caused confusion for users expecting a consistent visual experience when enlarging images.

How?

  • Adjusted the logic to ensure state.currentImage.uploadedSrc is used consistently when an enlarged image is available.
  • Added fallback logic to prevent empty or incorrect images from being displayed.

Testing Instructions

  1. Create a synced pattern containing an image block.
  2. Enable overrides for the image.
  3. Insert the synced pattern on a page and replace the image with a new one.
  4. Save and view the page on the front end.
  5. The lightbox shows the original image from the synced pattern.

…pattern with overridden image

Fixed the image lightbox showing original image issue in synced pattern with overridden image
@Sourav61 Sourav61 marked this pull request as ready for review March 10, 2025 11:58
@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @simonwammerfors.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: simonwammerfors.

Co-authored-by: Sourav61 <sourav08@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano 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 Mar 11, 2025
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

Successfully merging this pull request may close these issues.

Image lightbox shows original image in synced pattern with overridden image

2 participants