-
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
"Insert Before/After" menu options disappear if paragraph block is hidden from inserter #46753
Comments
This is very unintuitive behavior, especially considering it occurs when the paragraph block has only been hidden, not removed entirely. |
Hm.. I don't think we can make arbitrary decisions about setting a new default block, but maybe we would need a way to set the default block from the UI? 🤔 |
It seems like the most sensible solution would be a new default block whose only job is to show the inserter and the "type / to choose a block" prompt, perhaps conditionally based on if it's a restricted inner blocks container like the buttons block. By default it could allow typing anything prefixed with a |
Love the idea of an "inserter block" that can be utilized in these instances, like how @gwwar outlines in the second approach outlined in #23603 (comment). Our use case is that we have disabled the default paragraph block at the highest level, and only allow it as an innerBlock in some custom Gutenberg blocks that we have developed. |
Is there a reason we can't have it just open the block picker if there is no default block available? |
Description
The "Insert Before/After" items in the block options menu disappear when the paragraph block is disabled.
Step-by-step reproduction instructions
or
hideBlockTypes
to hide the paragraph block.Screenshots, screen recording, code snippet
via the UI:
CleanShot.2022-12-22.at.13.37.50.mp4
via Javascript run in the editor:
Environment info
WordPress version 6.1.1. The Gutenberg plugin is not active.
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
This issue is discussed in #23603 in the context of inner blocks, but this problem much wider in scope.
The text was updated successfully, but these errors were encountered: