InnerBlocks / Inserter: Auto-Add new block on click when allowedBlocks only contains 1 block #18017
Labels
[Feature] Inserter
The main way to insert blocks using the + button in the editing interface
[Feature] Nested / Inner Blocks
Anything related to the experience of nested/inner blocks inside a larger container, like Group or P
[Status] Duplicate
Used to indicate that a current issue matches an existing one and can be closed
Is your feature request related to a problem? Please describe.
I'm trying to build multiple blocks where there is only 1 specific block allowed in the InnerBlocks component, which is the specific sub-block i build for the main block (Slider -> Slider Item; Accordion -> Accordion Item, ...). The frustrating thing is that I can't find a way to make the Inserter autoselect the only block available.
Describe the solution you'd like
I'd like the
InnerBlocks.ButtonBlockAppender
to automatically add the block if only 1 is available.Describe alternatives you've considered
Otherwise some form of documentation for an example
renderAppender
function that actually adds a block. I've been trying to look through theInnerBlocks.ButtonBlockAppender
but I can't seem to find where the actual adding of the block is handled.The text was updated successfully, but these errors were encountered: