List View / Off Canvas appender doesn't respect allowedBlocks when InnerBlocks
isn't rendered
#18295
Labels
[Feature] List View
Menu item in the top toolbar to select blocks from a list of links.
[Feature] Nested / Inner Blocks
Anything related to the experience of nested/inner blocks inside a larger container, like Group or P
[Type] Bug
An existing feature does not function as intended
Describe the bug
Related #18100
This is a very niche issue and hard to explain, but one that might become apparent if we start using the block navigator more.
#18100 introduces a block appender in the navigator:
The issue experienced is that If a user accesses the navigator before
InnerBlocks
had rendered and then clicked an appender, the user could insert any type of inner block, despite there beingallowedBlocks
defined onInnerBlocks
.The issue was that the
InnerBlocks
component had some conditional rendering:gutenberg/packages/block-library/src/navigation-menu-item/edit.js
Lines 196 to 201 in 3d6392d
If for any reason the component wasn't rendered before accessing the navigator,
allowedBlocks
wouldn't work as registration of those allowed blocks is dependent on the component mounting.Questionable whether this is considered a flaw or a bug in the block implementation, but it's something that can't really be policed for third party blocks and could cause some very unusual issues for users creating posts.
The text was updated successfully, but these errors were encountered: