Skip to content

Gallery block: Block is broken when returning from HTML edit mode to visual edit mode #39310

@t-hamano

Description

@t-hamano

Description

In the new gallery block, when I select "Edit as HTML" and press the "Option" button, the block is broken.

I think that HTML editing should be prohibited in blocks that have child blocks (such as column blocks and group blocks).
But HTML editing is not prohibited in v1 gallery block, so the process should be switched between v1 / v2.

I found something even stranger, when I tried to resolve block , one of the comment delimiters in the image block was wp:fimage instead of wp:image.

captrue

Step-by-step reproduction instructions

  1. Insert gallery block.
  2. Select images or upload images.
  3. Insert the gallery without any particular editing.
  4. Select "Edit as HTML" from Block Toolbar Option.
  5. Do not edit the HTML, and press the option button shown in the upper left corner of the block.

Screenshots, screen recording, code snippet

9528d150b733a3ebacced0f8baddd2c6.mp4

Environment info

  • WordPress version: 5.9.1
  • Gutenberg version: latest(12.7.1)
  • Browser: Google Chrome 99.0.4844.51
  • OS:Windows 11

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] GalleryAffects the Gallery Block - used to display groups of images[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