From 1ac627f6f636ae511103400bcccf993abc3bb538 Mon Sep 17 00:00:00 2001 From: Michal Czaplinski Date: Wed, 28 Feb 2024 15:32:25 +0000 Subject: [PATCH] Move back the check for attribute value --- .../block-editor/src/hooks/use-bindings-attributes.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/block-editor/src/hooks/use-bindings-attributes.js b/packages/block-editor/src/hooks/use-bindings-attributes.js index fdcca0490616ad..9e923b3eb2d3ca 100644 --- a/packages/block-editor/src/hooks/use-bindings-attributes.js +++ b/packages/block-editor/src/hooks/use-bindings-attributes.js @@ -85,10 +85,6 @@ const BindingConnector = ( { const updateBoundAttibute = useCallback( ( newAttrValue, prevAttrValue ) => { - // Bail early if the attribute value is the same. - if ( prevAttrValue === newAttrValue ) { - return; - } /* * If the attribute is a RichTextData instance, * (core/paragraph, core/heading, core/button, etc.) @@ -115,6 +111,11 @@ const BindingConnector = ( { newAttrValue = RichTextData.fromHTMLString( newAttrValue ); } + // Bail early if the attribute value is the same. + if ( prevAttrValue === newAttrValue ) { + return; + } + onPropValueChange( { [ attrName ]: newAttrValue } ); }, [ attrName, onPropValueChange ]