Skip to content

Gallery: allow images to be added into blank Gallery via drag/drop #72882

@pkevan

Description

@pkevan

Description

In the Editor we allow blocks to transform, i.e. an image block can change into a gallery by adding another image into the block, and the reverse should be possible or at least avoiding blocking actions.

When you have moved all images out of a gallery block, the block stays as a Gallery, and you are able to add images in through upload or selection, but dragging an image does not result in it becoming part of the gallery.

Note: this does not appear related to the latest changes Drag and drop – Move block instead of drag chip as it is reproducible before this change.

Step-by-step reproduction instructions

  1. Create a gallery block with several images within it
  2. Drag the images out of the gallery block, elsewhere within the content
  3. Once there are no images within the gallery, the default gallery block is shown, allowing upload or selecting images from media library
  4. Attempt to drag an image into the block, and no action occurs.

Screenshots, screen recording, code snippet

screen-recording.mov

Environment info

  • trunk WP, with Gutenberg 21.9.0, MacOS, Chrome

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

    [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