From aa272f8432ca055961005a62c200a856e8017cb7 Mon Sep 17 00:00:00 2001 From: Joen A <1204802+jasmussen@users.noreply.github.com> Date: Fri, 16 Apr 2021 14:16:52 +0200 Subject: [PATCH] Add an initial value to the Site Logo block. (#30907) --- packages/block-library/src/site-logo/edit.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/block-library/src/site-logo/edit.js b/packages/block-library/src/site-logo/edit.js index d7c9da3181827a..9bd1d5eba276eb 100644 --- a/packages/block-library/src/site-logo/edit.js +++ b/packages/block-library/src/site-logo/edit.js @@ -141,6 +141,10 @@ const SiteLogo = ( { // becomes available. const maxWidthBuffer = maxWidth * 2.5; + // Set the default width to a responsible size. + // Note that this width is also set in the attached CSS file. + const defaultWidth = 120; + let showRightHandle = false; let showLeftHandle = false; @@ -181,6 +185,10 @@ const SiteLogo = ( { } min={ minWidth } max={ maxWidthBuffer } + initialPosition={ Math.min( + defaultWidth, + maxWidthBuffer + ) } value={ width || '' } disabled={ ! isResizable } />