Gutenberg: Add supports option to enable/disable group option per block

Created on 4 Jul 2019  路  5Comments  路  Source: WordPress/gutenberg

Currently every block seems to force the option to 'group' blocks together (outside of the group block itself). There is certain instances where you would not want a particular block to have this as an option. One instance of a core block is that individual columns seem to have the option, but upon clicking it nothing seems to happen. Another example would be a custom block (such as a full width carousel) that is forced to always be full width, grouping that block would break the layout.

I would suggest simply adding a supports.group attribute, with the default value of true. Setting it to false will remove the Group transform and block setting menu item.

[Block] Group [Feature] Block API [Type] Enhancement

Most helpful comment

This should be doable. As I've done a fair amount of work on this Block, I'm happy to put it on my radar unless anyone else wants to take it?

All 5 comments

From my closed duplicate issue #16446:

One common use case I see here is with child blocks that only exists within specific parent blocks. These likely do not need to ever be grouped. And if the Group block is not added as an allowed block within InnerBlocks, it doesn't get added anyhow.

Examples:

  1. A Form block with Field child blocks
  2. A Pricing Table block with child blocks within for each table

Sure, we could group the child blocks in these scenarios, but what value would we really add, and at what UX cost? If we're expecting users to first group before adding any background colors, that's quite a few extra steps to do so (vs. having a Background Color selection within the Settings Sidebar of the child block).

Proposal:
Perhaps child blocks are opted-out by default and must opt-in to support being grouped. And if so, the Group block should probably be white-listed as an allowed block within InnerBlocks - so we're not relying on folks to add it every time.

This issue is related to #16411 Page Break Block: should only be insertable at root level.

This should be doable. As I've done a fair amount of work on this Block, I'm happy to put it on my radar unless anyone else wants to take it?

Another option to solve this would be for the grouping option to be able to check for the allowed blocks of its parent. If the grouping block is not defined as allowed, the option shouldn't be displayed.

Closing as this PR was rejected on the basis that the feature is not going to be implemented.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maddisondesigns picture maddisondesigns  路  3Comments

ellatrix picture ellatrix  路  3Comments

pfefferle picture pfefferle  路  3Comments

mhenrylucero picture mhenrylucero  路  3Comments

aaronjorbin picture aaronjorbin  路  3Comments