From c42b6cc4ca6004f9890e1aadce280c7aec7d1a9c Mon Sep 17 00:00:00 2001 From: Ramon Date: Tue, 9 Apr 2024 09:39:50 +1000 Subject: [PATCH] Background image: display default background size value in global styles (#60490) * rename constant to BACKGROUND_DEFAULT_VALUES ensure that the default background size is displayed in the control * Tesating if `currentValueForToggle` is a good substitute for sizeValue to determine if the size control should be displayed Co-authored-by: ramonjd Co-authored-by: andrewserong Co-authored-by: jameskoster --- .../src/components/global-styles/background-panel.js | 6 +++--- packages/block-editor/src/hooks/background.js | 4 ++-- .../src/components/global-styles/background-panel.js | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/block-editor/src/components/global-styles/background-panel.js b/packages/block-editor/src/components/global-styles/background-panel.js index 1288ff823b46cd..c1354bbc4a4e14 100644 --- a/packages/block-editor/src/components/global-styles/background-panel.js +++ b/packages/block-editor/src/components/global-styles/background-panel.js @@ -492,9 +492,9 @@ function BackgroundSizeToolsPanelItem( { label={ __( 'Fixed' ) } /> - { sizeValue !== undefined && - sizeValue !== 'cover' && - sizeValue !== 'contain' ? ( + { currentValueForToggle !== undefined && + currentValueForToggle !== 'cover' && + currentValueForToggle !== 'contain' ? ( ); }