Skip to content

Commit

Permalink
Gallery: Set the 'defaultBlock' setting for inner blocks (WordPress#5…
Browse files Browse the repository at this point in the history
…9168)

* Gallery: Set the 'defaultBlock' setting for inner blocks
* Set 'directInsert' to true

Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: aaronrobertshaw <[email protected]>
  • Loading branch information
3 people authored Feb 20, 2024
1 parent 54ff049 commit c4b422a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/block-library/src/gallery/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const MOBILE_CONTROL_PROPS_RANGE_CONTROL = Platform.isNative
? { type: 'stepper' }
: {};

const DEFAULT_BLOCK = { name: 'core/image' };
const EMPTY_ARRAY = [];

function GalleryEdit( props ) {
Expand Down Expand Up @@ -496,6 +497,8 @@ function GalleryEdit( props ) {
};

const innerBlocksProps = useInnerBlocksProps( blockProps, {
defaultBlock: DEFAULT_BLOCK,
directInsert: true,
orientation: 'horizontal',
renderAppender: false,
...nativeInnerBlockProps,
Expand Down

0 comments on commit c4b422a

Please sign in to comment.