From bbc0041d5bb4d9b97cafcdf5c52e989ea371ecc7 Mon Sep 17 00:00:00 2001
From: thisissandip <69596988+thisissandip@users.noreply.github.com>
Date: Thu, 3 Jun 2021 15:50:31 +0530
Subject: [PATCH] Fixed random collapse of the color settings section (#32388)
---
packages/block-editor/src/hooks/style.js | 28 ++++++++++++++----------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/packages/block-editor/src/hooks/style.js b/packages/block-editor/src/hooks/style.js
index c0410a7c7b92f9..5fe41775a51ee0 100644
--- a/packages/block-editor/src/hooks/style.js
+++ b/packages/block-editor/src/hooks/style.js
@@ -243,9 +243,7 @@ export const withBlockControls = createHigherOrderComponent(
const withElementsStyles = createHigherOrderComponent(
( BlockListBlock ) => ( props ) => {
const elements = props.attributes.style?.elements;
- if ( ! elements ) {
- return ;
- }
+
const blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(
BlockListBlock
) }`;
@@ -256,17 +254,23 @@ const withElementsStyles = createHigherOrderComponent(
return (
<>
-
+ { elements && (
+
+ ) }
+
>
);