From c4b422a08ab21811538552da8b93f785253eda26 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Tue, 20 Feb 2024 11:38:38 +0400 Subject: [PATCH] Gallery: Set the 'defaultBlock' setting for inner blocks (#59168) * Gallery: Set the 'defaultBlock' setting for inner blocks * Set 'directInsert' to true Co-authored-by: Mamaduka Co-authored-by: aaronrobertshaw --- packages/block-library/src/gallery/edit.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/block-library/src/gallery/edit.js b/packages/block-library/src/gallery/edit.js index 226e4da673d95..0a9dd631dfe52 100644 --- a/packages/block-library/src/gallery/edit.js +++ b/packages/block-library/src/gallery/edit.js @@ -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 ) { @@ -496,6 +497,8 @@ function GalleryEdit( props ) { }; const innerBlocksProps = useInnerBlocksProps( blockProps, { + defaultBlock: DEFAULT_BLOCK, + directInsert: true, orientation: 'horizontal', renderAppender: false, ...nativeInnerBlockProps,