Number of blocks selected (when using container blocks) is inaccurate or misleading #56068
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
- Add a Group and a Paragraph block to the root of a document
- Add some blocks to the Group block
- Select all blocks in the document
- 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.
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