-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InnerBlocks allowedBlocks
does not remove non-whitelisted blocks
#46281
Comments
FYI you can replicate this situation by following the test instructions in #46279 and then going to the Editor. |
might be a dupe of #15682 ? |
Thanks. I took a quick look. I think this [ |
I think this is similar to the discussion in #25787, although a different case.
The lengths a user has to go to in order to add a nav block in a nav block are much more extreme though, and my feeling is that if a user feels advanced enough to do that they should also be advanced enough to deal with the repercussions of making a mistake. If it's a bad enough situation then I guess some custom code could be added to the nav block on the editor side, which I think could be similar to the recursion provider idea (bypass rendering of the block and show an error instead). |
Thanks @talldan. Having spoken with @jorgefilipecosta in a DM on Slack I now understand this to be the case. I agree it's a pretty major edge case. We should be easily able to detect a Hopefully @jorgefilipecosta can add some more context about |
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: