When allowedBlocks includes core/block and one other block type, can't insert core/block #52401
Labels
[Feature] Inserter
The main way to insert blocks using the + button in the editing interface
[Type] Bug
An existing feature does not function as intended
Description
When you click an appender and there are multiple allowedBlocks, it asks you which block type to insert in a popup. This is good.
If there is precisely one block in allowedBlocks, it auto-inserts that one block instead of asking you what to insert. This is good.
If there are precisely two allowedBlocks, and one is a core/block, then it auto-inserts the other block instead of giving you a choice. This is a bug.
Step-by-step reproduction instructions
Make sure you have created at least one reusable block on the site somewhere.
Build a new block type which uses InnerBlocks and an allowedBlocks parameter set to, say ['core/block','core/image'].
Insert the block, and click the appender - it will automatically insert an image.
Change to ['core/block','core/image','core/paragraph'] and try again, and it will now prompt you whether you want to add an image, paragraph, or a reusable block.
It should be asking you in the first case as well.
Screenshots, screen recording, code snippet
No response
Environment info
WP 6.2.2, no Gutenberg plugin, all browsers.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: