Skip to content

Number of blocks selected (when using container blocks) is inaccurate or misleading #56068

Open
@andrewserong

Description

Description

When performing a multi-selection, the number of blocks that are selected are announced or flagged in the UI based on the number of blocks at the current level of the hierarchy. The calculation does not include all child blocks that are part of that selection.

For example, if you have a post containing a Group and a Paragraph block at the root of a document, and then go to add a number of child blocks to the Group block, and select all blocks, then the UI will think that only two blocks are selected.

Question ❓

What is the desired behaviour here? I assume it would be for the reported number of blocks selected to contain all children blocks? It might be tricky to do accurately as a selection can include synced patterns or template parts which might not be resolved or available within the current context.

Step-by-step reproduction instructions

  1. Add a Group and a Paragraph block to the root of a document
  2. Add some blocks to the Group block
  3. Select all blocks in the document
  4. Notice that the UI or announcements will communicate that only 2 blocks are selected

Screenshots, screen recording, code snippet

The following screenshot demonstrates all blocks in a document being selected (A Group containing many paragraphs, and another paragraph block at the root of the document). In this example, the user might expect the number of blocks selected to be reported as 18 in total (including all child blocks), however it is reported that only 2 blocks are selected.

image

Environment info

No response

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    [Feature] Block Multi SelectionThe ability to select and manipulate multiple blocks[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