Skip to content
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

When allowedBlocks includes core/block and one other block type, can't insert core/block #52401

Closed
smerriman opened this issue Jul 7, 2023 · 1 comment · Fixed by #52546
Closed
Assignees
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

Comments

@smerriman
Copy link

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

@jordesign jordesign added [Type] Bug An existing feature does not function as intended [Feature] Blocks Overall functionality of blocks Needs Testing Needs further testing to be confirmed. labels Jul 7, 2023
@Mamaduka
Copy link
Member

I can reproduce the issue. Here's an example of the Group block.

<!-- wp:group {"allowedBlocks":["core/paragraph","core/block"],"layout":{"type":"constrained"}} -->
<div class="wp-block-group"></div>
<!-- /wp:group -->

@Mamaduka Mamaduka added [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P and removed Needs Testing Needs further testing to be confirmed. labels Jul 11, 2023
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 12, 2023
@Mamaduka Mamaduka added [Feature] Inserter The main way to insert blocks using the + button in the editing interface and removed [Feature] Blocks Overall functionality of blocks [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P labels Jul 12, 2023
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants