Skip to content

Commit

Permalink
Gallery: Avoid creating new layout objects on every render (#46715)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Dec 21, 2022
1 parent 8a71fd8 commit 3922379
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/block-library/src/gallery/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const linkOptions = [
];
const ALLOWED_MEDIA_TYPES = [ 'image' ];
const allowedBlocks = [ 'core/image' ];
const LAYOUT = { type: 'default', alignments: [] };

const PLACEHOLDER_TEXT = Platform.isNative
? __( 'ADD MEDIA' )
Expand Down Expand Up @@ -489,7 +490,7 @@ function GalleryEdit( props ) {
allowedBlocks,
orientation: 'horizontal',
renderAppender: false,
__experimentalLayout: { type: 'default', alignments: [] },
__experimentalLayout: LAYOUT,
} );

if ( ! hasImages ) {
Expand Down

1 comment on commit 3922379

@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.
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/3751576162
📝 Reported issues:

Please sign in to comment.