Skip to content

Gallery: removing images doesn't update maximum number of columns #13423

@simison

Description

@simison

Describe the bug
Gallery block allows the maximum number of columns not be higher than the number of images.

When removing images via "Edit gallery" button from the block's toolbar, the number columns does not get reflected to "new maximum".

To Reproduce
Steps to reproduce the behavior:

  1. Go to block editor

  2. Add gallery block and some images to it

  3. From the sidebar, change the number of columns to maximum

  4. Press "pen" icon from block's toolbar to "edit gallery"

  5. Remove image from media modal

  6. Observe the number of columns stay higher than the number of images:

    image

Removing images via "x" icons on corners works and updates the number of columns correctly.

Expected behavior
I expected a number of columns to be lowered to match the number of images.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser Firefox
  • Version 64

We found out about this while building a custom gallery block that also relies on media modal:
Automattic/wp-calypso#30015

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