Skip to content

Nesting issues in write mode #71202

@tellthemachines

Description

@tellthemachines

Description

There are a few problems with container blocks and nesting in write mode:

  1. It's possible to add a Group block at root level, though you can't do anything with it. Even trying to change the style variation does nothing. Same for Columns block.

  2. It's also possible to duplicate any block at root level (this might be intended but it's weird because it can substantially change the layout of a template)

3. Some container blocks (Quote, Details, Cover and Media & text), when nested inside another container, allow the slash inserter to appear, though trying to add a block with it doesn't work. The following console error appears in those cases: index.tsx:117 Uncaught TypeError: onReplace is not a function (errors on this line). What these blocks all have in common is that they are both containers with inner blocks and have the "content" role.

Edit: 3 is now fixed by #71232.

Step-by-step reproduction instructions

  1. Add some blocks to a template, including a Group block with a Cover, Quote or Details block inside it.
  2. Enable write mode
  3. Try to add a Group block at root level and see that it is added, but can't be edited in any way
  4. Try using the slash inserter inside the nested Cover, Quote or Details and see it appears, but doesn't work.

Screenshots, screen recording, code snippet

containers_write_mode.mp4

Environment info

Latest Gutenberg trunk.

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions