-
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
Make the 'Insert Before' / 'Insert After' options work for block lists that don't allow the default block type #23603
Comments
A couple other ideas here could include:
|
I'd expect that blocks can define a defaultInnerBlock, which would allow these options to work. In the case of the Buttons block, it would define it's default as the Button block and support options for "Insert Button Before/After". With the Navigation block, the default would be the Link block and support options for "Insert Link Before/After". I wouldn't expect the Quick Library (a.k.a. Inline Inserter) to appear, as that's not how these menu options work everywhere else in the editor. |
This sounds like a good suggestion, that'll probably work well for the buttons and potentially the navigation block. For social I don't think any of the icons could be considered default, but probably just have to accept that as an edge case that can't be solved. |
This is larger in scope than anticipated, so priority was lowered. I'm putting this one on hold until we close a few other navigation issues. Other folks are welcome to try fixing this one in the meantime. To recap the exploration in #29490: Specifying a default innerBlock works, but it's a bit limited. For blocks that have many variants a better solution would be to show the quick inserter See how awkward this is in social links? social-link-variations.mp4It kind of works for navigation, but we can't transform from a page link to say a spacer. navigationpageinsert.mp4Folks are leaning toward leveraging the quick inserter. Note that the quick inserter already auto-inserts the block when there's only one block type available, so this works well for something like buttons that can only accept button blocks. Here are two potential approaches:
PoC.mp4 |
Is your feature request related to a problem? Please describe.
While working on the Navigation Block it was observed that the Insert Before and Insert After options are missing within the block.
I did some investigation, and it looks like these options only work when the Default Block (i.e. Paragraph) is supported. For blocks like Navigation, Buttons, or Social that don't support paragraphs, the options don't appear.
Describe the solution you'd like
Could Insert Before or Insert After trigger an inserter menu if the default block can't be inserted? It's unclear to me how that could work, but some design exploration might yield some results.
Describe alternatives you've considered
Another option, is that if the block only supports single inner block types (Navigation -> Navigation Link, Buttons -> Button), Insert Before could result in just that block only being inserted.
This would still result in the option being unavailable for blocks like Social that support multiple block types.
The text was updated successfully, but these errors were encountered: