InnerBlocks allowedBlocks
does not remove non-whitelisted blocks
#46281
Labels
Needs Technical Feedback
Needs testing from a developer perspective.
[Package] Block editor
/packages/block-editor
[Type] Bug
An existing feature does not function as intended
In testing a bug with the Navigation block I came upon a situation whereby a Navigatino block could be rendered inside a Navigatino block.
This happens because the Nav block primarily uses controlled inner blocks. If those blocks contain a Navigation block then it appears it is rendered.
The Nav block sets the
allowedBlocks
property onuseInnerBlocksProps
which updates the block list settings with a small subset of blocks that are allowed inside the Nav block. Despite this however, the Nav block is still included in the inner blocks of the Nav block.I cannot find anywhere in the code where allowedBlocks is applied to the block list. It is used to filter the items in the inserter but that seems to be it.
I'd like to confirm:
allowedBlocks
to take a more active role in filtering the block listThe text was updated successfully, but these errors were encountered: