Skip to content

Commit

Permalink
Gallery: Avoid creating new layout objects on every render
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Dec 21, 2022
1 parent cbacc8d commit e9c7aef
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 e9c7aef

@github-actions
Copy link

@github-actions github-actions bot commented on e9c7aef Dec 21, 2022

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/3751068204
📝 Reported issues:

Please sign in to comment.