Skip to content

Commit 4d7d805

Browse files
Block Editor: Clarify logic for 'directInsert' inner blocks setting (#77873)
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
1 parent 54af1ce commit 4d7d805

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎docs/how-to-guides/block-tutorial/nested-blocks-inner-blocks.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ By default `InnerBlocks` opens a list of permitted blocks via `allowedBlocks` wh
7171
/>
7272
```
7373

74-
This behavior is disabled until the `directInsert` prop is set to `true`. This allows you to specify conditions for when the default block should or should not be inserted.
74+
Set `directInsert` to `true` to force the appender to insert the `defaultBlock` immediately, bypassing the inserter dropdown, including any registered inserter variations of that block type. Leave it unset (or `false`) to let the appender open the inserter so users can pick a variation.
75+
76+
Note: redundant when `allowedBlocks` resolves to a single block type with no variations, the appender already inserts directly.
7577

7678
## Template
7779

‎packages/block-editor/src/components/inner-blocks/README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,8 @@ const DEFAULT_BLOCK = { name: 'core/paragraph', attributes: { content: 'Lorem ip
205205
### `directInsert`
206206

207207
- **Type:** `Boolean`
208-
- **Default:** - `undefined`. Determines whether the default block should be inserted directly into the InnerBlocks area by the block appender.
208+
- **Default:** `undefined`.
209+
210+
When `true`, the appender inserts `defaultBlock` directly and skips the inserter dropdown, **including any registered inserter variations** of that block type. Use this to opt out of the variation picker; otherwise leave unset.
211+
212+
Note: redundant when `allowedBlocks` resolves to a single block type with no variations, the appender already inserts directly.

0 commit comments

Comments
 (0)