-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix template part / reusable block click through on non-safari browsers #40339
Conversation
…ents:none on child elements
Size Change: -2 B (0%) Total Size: 1.23 MB
ℹ️ View Unchanged
|
I think removing
MDN - https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events#description This fixes the #40309 issue with Firefox and works in Chrome, Safari. Unfortunately, the #35079 bug also affects edit locking, with or without this fix. You can test this by placing the Site Title inside the reusable block. Maybe we can use the ScreencastCleanShot.2022-04-14.at.12.49.01.mp4 |
I didn't know the editor had edit locking, so I wasn't sure how to test it. 😄
A concern I'd have with |
The feature will be limited to Reusable blocks in 6.0.
I tried this idea, but the selection change still happens for RichText elements.
Good suggestion. Thanks, Dan. |
It looks like it is supposed to set gutenberg/packages/compose/src/hooks/use-disabled/index.js Lines 77 to 79 in 53977c6
|
@Mamaduka I did think of one issue here. Some of the site editor blocks (post title, author etc) update entities directly rather than using attributes, so they'd still be editable. If the edit locking feature is limited to the reusable block, then it might be ok. |
Using overlay works for Reusable blocks (mostly), but obscuring selection won't work for all the blocks. It is one of the reasons we're enabling edit locking only for this block. I think we'll need to define full specs of what edit locking means for various blocks before considering full implementation. |
Are we still aiming to get this into 6.0? If not, I will remove it from the project board and remove the backport label. Thanks! |
I think so - it needs a review though. I'll add some more reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing! |
This was backported to wp/6.0 branch to be included in WordPress 6.0 Beta 3 today: 1ed0e07 |
What?
Partial fix for #35079 (it's still broken in Safari)
Fixes some situations where the BlockContentOverlay was allowing click through to child elements when it wasn't supposed to.
Unfortunately Safari is still broken. The brokenness seems to be a quirk of browsers allowing inline elements (especially links) to receive clicks even when
pointer-events: none
is set (https://bugs.webkit.org/show_bug.cgi?id=239486).How?
Follows the suggestion in #40309 (comment) (props @MarieComet).
When a template part / reusable block or its child are unselected, BlockContentOverlay renders a
:before
pseudo-element as an overlay (which can be seen on hover) and also setspointer-events: none
on all its children.The
:before
overlay also hadpointer-events: none
set, but I don't know why. It seems like it could effectively be used to block clicks. So I've deleted that line and the overlay is now being used to prevent click through.Testing Instructions
Expected - the reusable block is selected (not the site title).