Skip to content
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

Any (synced) block patterns in a post stops blocks deeply nested in templateLock: contentOnly parents from being editable #54561

Closed
wongjn opened this issue Sep 18, 2023 · 2 comments · Fixed by #54618
Assignees
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@wongjn
Copy link

wongjn commented Sep 18, 2023

Description

If I have a structure like:

<!-- wp:group {"templateLock":"contentOnly","layout":{"type":"default"}} -->
<div class="wp-block-group">
  <!-- wp:group {"layout":{"type":"constrained"}} -->
  <div class="wp-block-group">
    <!-- wp:paragraph -->
    <p>Some text</p>
    <!-- /wp:paragraph -->
  </div>
  <!-- /wp:group -->
</div>
<!-- /wp:group -->

The paragraph block's text is editable.

However, when adding a synced block pattern to the content, the paragraph block is no longer editable – the immediate parent core/group block has inert="true" and is-editing-disabled HTML class applied to it. I have only tested with synced block patterns. It could well be the same for unsynced.

Step-by-step reproduction instructions

  1. Create a synced block pattern in the site editor with any content.
  2. Create a new page.
  3. Switch to the code editor, paste in the code mentioned previously.
  4. Switch back to visual editor and notice that the paragraph content can be edited.
  5. Add the synced block pattern from step 1 into the page content.
  6. Try to edit the paragraph content now and observe how it cannot be edited.

Screenshots, screen recording, code snippet

a3bc59c5-14ee-42a4-a2da-ae6e85abee44.mp4

Environment info

Replicated in:

  • WordPress 6.3.1
  • WordPress Playground 6.3
  • Chrome Version 116.0.5845.188 (Official Build) (64-bit)

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@Mamaduka Mamaduka added Needs Testing Needs further testing to be confirmed. [Block] Pattern Affects the Patterns Block [Type] Bug An existing feature does not function as intended [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced and removed Needs Testing Needs further testing to be confirmed. [Block] Pattern Affects the Patterns Block labels Sep 18, 2023
@aaronrobertshaw aaronrobertshaw moved this to Todo in Patterns Sep 19, 2023
@Mamaduka
Copy link
Member

I think synced patterns don't cause the issue, but it's more apparent when testing with them.

I can also reproduce the bug by adding a new paragraph after the "content locked" group (see screencast below), but the issue disappears when I save the post and refresh the page.

I will assign this to myself and continue looking for a source of the bug.

Screencast

CleanShot.2023-09-19.at.11.44.11.mp4

@Mamaduka Mamaduka self-assigned this Sep 19, 2023
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Sep 19, 2023
@Mamaduka
Copy link
Member

Here's to PR to fix the issue #54618.

@github-project-automation github-project-automation bot moved this from Todo to Done in Patterns Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants