-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Click-through pattern not behaving as expected for Template Parts #35079
Comments
If I create a reusable block with a Site Title in it, I can repro the same behavior there as well. 🤔 I can't seem to repro in either with just the navigation block as is seen in your gif. |
It seems possibly related to For the SiteTitle, I notice the issue is no longer present if I change the RichText's I can also repro the same issue by adding a Buttons/Button block with some text in it (it also uses RichText, although not any a tag): Although there are plenty of other blocks that use RichText that don't seem to have any issue. |
I'm removing this issue from WP 5.9 project board since RC1 was released last night. We can try and work on the fix for the next minor release. |
This came up as part of the twelfth call for testing for the FSE Outreach Program:
I've experienced this personally and have also seen this come up throughout the community as folks are trying to ensure that they are adding content to the right spaces. Since template parts update everywhere, it's key that we ensure folks have a way to do so without much friction. The current experience makes this difficult without using List View. |
I would dearly love to see this issue fixed. The longer it exists in production the more folks get used to the broken experience and interpret it as the norm, which might make changing it more difficult down the road. |
I did some debugging. From what I can tell this is related to particular blocks being used inside Template Part rather than the template part itself. As an example, add a Site Title into a Reusable Block, and the Reusable Block also has this issue. So what's different about a Site Title? The only thing I've been able to change to stop this from happening is the tag name used by the site title. Commenting out this line makes things behave as they should:
So I think this is happening for any inline RichText elements (since it also happens when the site title renders a I'm still not sure of the root cause. This is the event handler being triggered that results in selection, but I don't know why it only triggers for inline Rich Texts:
|
Thanks for doing some debugging @talldan. Is this a bug we think we can reasonably tackle for 6.0? Just trying to figure out what needs to remain on the 6.0 Project Board. Thanks! |
This was missed for 5.9. It would be a real shame if it didn't make it into 6.0 either 😔 |
I don't think there's any reason to punt it yet, it'd be a good bug to fix, even if I still have no idea how to fix it 😄 |
The suggestion here does help - #40309 (comment). I've made a PR - #40339. After some searching I discovered a few other people complaining that browsers don't respect From what I can tell the above PR fixes things in most browsers, but Safari was notably still broken. |
I've reported the Safari issue upstream - https://bugs.webkit.org/show_bug.cgi?id=239486 |
@jameskoster, do you think we can close this now that #40649 is merged? |
Yes, I think so :) |
Description
There is currently a small discrepancy between the selection behaviour for Template Parts and Reusable Blocks on the canvas.
Both utilise the 'overlay' and 'click-through' pattern which dictates that regardless of where you click on the block, the parent will always be selected first. Subsequent clicks are required to select children. Here's how that works for Reusable Blocks:
RB.mp4
The same is not true of Template Parts. In the video below I am able to bypass the click-through and directly select the Site Title and the Navigation block:
TP.mp4
It's interesting that clicking the site tagline block doesn't bypass the click-through, so I'm not sure if the problem is with the Template Part block, or the Site Title and Navigation blocks instead.
The issue exists in both the template editor and the site editor.
Step-by-step reproduction instructions
The text was updated successfully, but these errors were encountered: