Skip to content

Fix: Click-through blur effect when gallery images have a caption.#69067

Merged
t-hamano merged 2 commits into
WordPress:trunkfrom
Rishit30G:fix/click-through-blur-effect
May 29, 2025
Merged

Fix: Click-through blur effect when gallery images have a caption.#69067
t-hamano merged 2 commits into
WordPress:trunkfrom
Rishit30G:fix/click-through-blur-effect

Conversation

@Rishit30G

Copy link
Copy Markdown
Contributor

What?

Closes #69061

Why?

This PR is intended to resolve the issue which makes the blur effect block the image click

How?

This PR makes the following changes to the SCSS file:

pointer-events: none;
cursor: pointer;

This will help the cursor to appear on the blur part of the image and it will be clickable as well

Testing Instructions

  • Create a new post
  • Add a new gallery block
  • Add some images to the gallery block
  • Add caption to the images
  • Notice the images in the frontend
  • Notice that large part of the area above the caption is now clickable, previously it was not

Screenshots or screencast

Before After
https://github.com/user-attachments/assets/3b9bca6f-63ec-4f9e-9d9c-e3538f2e413a https://github.com/user-attachments/assets/a42643fa-bb90-497d-8c74-5e3d3cda3c1c

PS: Sorry for the bad screen recording, my laptop's screen recorder wasn't able to show the cursor: pointer behaviour so had to rely on phone for recording 😓

@github-actions

github-actions Bot commented Feb 6, 2025

Copy link
Copy Markdown

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: @CruelDrool.

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: CruelDrool.

Co-authored-by: Rishit30G <rishit30g@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Block] Gallery Affects the Gallery Block - used to display groups of images labels Feb 6, 2025
@t-hamano t-hamano self-requested a review May 29, 2025 04:49

@t-hamano t-hamano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply.

The changes look good to me, but can you rebase this PR?

Additionally, is there a reason why you added cursor:pointer in addition to pointer-events:none?

@Rishit30G Rishit30G force-pushed the fix/click-through-blur-effect branch from fabfd09 to 82a82d3 Compare May 29, 2025 05:32
@Rishit30G

Copy link
Copy Markdown
Contributor Author

Thanks for the review @t-hamano! 🙇🏻

I have rebased the PR

Additionally, is there a reason why you added cursor:pointer in addition to pointer-events:none?

The element has pointer-events: none; so that clicks or interactions will "pass through" it to elements underneath i.e the image
As of now because of the background blur layer, the pointer styles are there but it is not able to redirect to the image url, pointer-events: none; fixes it

@t-hamano

Copy link
Copy Markdown
Contributor

I didn't see the difference between having cursor:pointer and not having it. Will removing cursor:pointer cause any problems?

@Rishit30G

Copy link
Copy Markdown
Contributor Author

On rechecking, agreed it doesn't add any visual change, apologies for the overlook 🙇🏻

@t-hamano t-hamano merged commit f48a339 into WordPress:trunk May 29, 2025
60 checks passed
@github-actions github-actions Bot added this to the Gutenberg 21.0 milestone May 29, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
…ordPress#69067)

* Add pointer-events and cursor styles to gallery images

* remove cursor pointer

Unlinked contributors: CruelDrool.

Co-authored-by: Rishit30G <rishit30g@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Click-through blur effect when gallery images have a caption.

3 participants