From a2c7a76c31fd53fb01da4e7b0a5c128ef93bc743 Mon Sep 17 00:00:00 2001 From: Ceyhun Ozugur Date: Fri, 30 Jul 2021 17:31:17 +0200 Subject: [PATCH] Filter wrapper styles before merging with rest --- .../src/mobile/global-styles-context/index.native.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/components/src/mobile/global-styles-context/index.native.js b/packages/components/src/mobile/global-styles-context/index.native.js index 2626e0cec5ba61..e33e86d636aafe 100644 --- a/packages/components/src/mobile/global-styles-context/index.native.js +++ b/packages/components/src/mobile/global-styles-context/index.native.js @@ -36,10 +36,17 @@ export const getMergedGlobalStyles = ( blockAttributes, BLOCK_STYLE_ATTRIBUTES ); + // This prevents certain wrapper styles from being applied to blocks that + // don't support them yet. + const wrapperPropsStyleFiltered = pick( + wrapperPropsStyle, + BLOCK_STYLE_ATTRIBUTES + ); + const mergedStyle = { ...baseGlobalColors, ...globalStyle, - ...wrapperPropsStyle, + ...wrapperPropsStyleFiltered, }; const blockColors = getBlockColors( blockStyleAttributes,