Skip to content

Commit

Permalink
Gallery: Set the 'defaultBlock' setting for inner blocks (#59168)
Browse files Browse the repository at this point in the history
* Gallery: Set the 'defaultBlock' setting for inner blocks
* Set 'directInsert' to true

Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
  • Loading branch information
3 people committed 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

1 comment on commit c4b422a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in c4b422a.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7969982854
📝 Reported issues:

Please sign in to comment.