From 42d8378de90a95745b152261b4c8032de7c48e67 Mon Sep 17 00:00:00 2001 From: Ricardo Artemio Morales Date: Tue, 19 Sep 2023 19:51:54 -0400 Subject: [PATCH 1/2] Modify conditional when parsing config --- packages/block-editor/src/components/global-styles/hooks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/global-styles/hooks.js b/packages/block-editor/src/components/global-styles/hooks.js index 4bbc9c40588e03..a68c4687c32aa6 100644 --- a/packages/block-editor/src/components/global-styles/hooks.js +++ b/packages/block-editor/src/components/global-styles/hooks.js @@ -117,7 +117,7 @@ export function useGlobalSetting( propertyPath, blockName, source = 'all' ) { `settings${ appendedBlockPath }.${ setting }` ) ?? getValueFromObjectPath( configToUse, `settings.${ setting }` ); - if ( value ) { + if ( value !== undefined && value !== null ) { result = setImmutably( result, setting.split( '.' ), value ); } } ); From e18095d6e80e6863bdf7d4be67c57b7848abbbdf Mon Sep 17 00:00:00 2001 From: Michal Czaplinski Date: Thu, 21 Sep 2023 18:43:12 +0100 Subject: [PATCH 2/2] Only drop the value if it's undefined. --- packages/block-editor/src/components/global-styles/hooks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/global-styles/hooks.js b/packages/block-editor/src/components/global-styles/hooks.js index a68c4687c32aa6..356ff4dce57a90 100644 --- a/packages/block-editor/src/components/global-styles/hooks.js +++ b/packages/block-editor/src/components/global-styles/hooks.js @@ -117,7 +117,7 @@ export function useGlobalSetting( propertyPath, blockName, source = 'all' ) { `settings${ appendedBlockPath }.${ setting }` ) ?? getValueFromObjectPath( configToUse, `settings.${ setting }` ); - if ( value !== undefined && value !== null ) { + if ( value !== undefined ) { result = setImmutably( result, setting.split( '.' ), value ); } } );