Skip to content

Click-through pattern not behaving as expected for Template Parts #35079

@jameskoster

Description

@jameskoster

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

  1. Install and activate a block theme.
  2. If one doesn't exist, create a Header template part and place it in whichever template is used to render pages.
  3. Ensure the Header template part includes an instance of the Site Title and Navigation blocks.
  4. Edit a page in the post editor.
  5. In the Template section of the Inspector, click 'Edit'.
  6. Hover the Site Title or Navigation block and click
  7. Notice that the Site Title or Navigation block is selected rather than the Header template part

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] NavigationAffects the Navigation Block[Block] Site TitleAffects the Site Title Block[Block] Template PartAffects the Template Parts Block[Feature] Template Editing ModeRelated to the template editor available in the Block Editor[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions