-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
What problem does this address?
Part of #41236.
When you have a custom tabs block for example you can build that to work similar to the core columns block. You have one wrapping block that contains individual tab item or column blocks that intern allow editors to place other blocks inside of them. The issue however is that you may want to restrict the ability of editors to add more than 5 tabs which currently isn't possible.
Tabs are just an example here. This applies to all kinds of blocks that follow the parent/child block relationship. Even the Core Columns block doesn't really support more than 6 columns. But editors can still select an individual column block and duplicate it.
As a workaround, you can define a custom renderAppender
function for the area of the inner block and only render the custom block appended whenever there are fewer than the max number of items in the area of the inner block. But that still doesn't solve the root issue because editors can still duplicate a block to create more than should be possible.
What is your proposed solution?
Add a new optional prop to the InnerBlocks
props that allows developers to set a max number of items. It could also be achieved by introducing a new level of templateLock
which would prevent adding more items whilst still not locking down any of the already existing items.