From 9839ad35bf78f712c2c8ba6cbc5198aed49a44d7 Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Tue, 8 Aug 2023 12:35:05 -0500 Subject: [PATCH 1/2] Clear aspect ratio when alignment is set to full or wide as controls are not available --- packages/block-library/src/image/image.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/image/image.js b/packages/block-library/src/image/image.js index 7caba6843b7224..fd3d9eac54296f 100644 --- a/packages/block-library/src/image/image.js +++ b/packages/block-library/src/image/image.js @@ -326,7 +326,7 @@ export default function Image( { function updateAlignment( nextAlign ) { const extraUpdatedAttributes = [ 'wide', 'full' ].includes( nextAlign ) - ? { width: undefined, height: undefined } + ? { width: undefined, height: undefined, aspectRatio: undefined } : {}; setAttributes( { ...extraUpdatedAttributes, From ae34f9c451b9ecbc1aed44cd62413d734d95d2fc Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Tue, 8 Aug 2023 15:56:08 -0500 Subject: [PATCH 2/2] Also clear scale --- packages/block-library/src/image/image.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/image/image.js b/packages/block-library/src/image/image.js index fd3d9eac54296f..c4f0f62c848108 100644 --- a/packages/block-library/src/image/image.js +++ b/packages/block-library/src/image/image.js @@ -326,7 +326,12 @@ export default function Image( { function updateAlignment( nextAlign ) { const extraUpdatedAttributes = [ 'wide', 'full' ].includes( nextAlign ) - ? { width: undefined, height: undefined, aspectRatio: undefined } + ? { + width: undefined, + height: undefined, + aspectRatio: undefined, + scale: undefined, + } : {}; setAttributes( { ...extraUpdatedAttributes,