Skip to content

Commit

Permalink
Move back the check for attribute value
Browse files Browse the repository at this point in the history
  • Loading branch information
michalczaplinski committed Feb 28, 2024
1 parent 6dd46e8 commit 1ac627f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/block-editor/src/hooks/use-bindings-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand All @@ -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 ]
Expand Down

0 comments on commit 1ac627f

Please sign in to comment.