diff --git a/packages/block-editor/src/hooks/block-bindings.js b/packages/block-editor/src/hooks/block-bindings.js index 33284b4cd27fd..ea0d4cbb7fb5b 100644 --- a/packages/block-editor/src/hooks/block-bindings.js +++ b/packages/block-editor/src/hooks/block-bindings.js @@ -218,7 +218,7 @@ export const BlockBindingsPanel = ( { name: blockName, metadata } ) => { context, } ); // Only add source if the list is not empty. - if ( sourceList ) { + if ( Object.keys( sourceList || {} ).length ) { _fieldsList[ sourceName ] = { ...sourceList }; } } @@ -240,12 +240,6 @@ export const BlockBindingsPanel = ( { name: blockName, metadata } ) => { if ( ! bindableAttributes || bindableAttributes.length === 0 ) { return null; } - // Remove empty sources from the list of fields. - Object.entries( fieldsList ).forEach( ( [ key, value ] ) => { - if ( ! Object.keys( value ).length ) { - delete fieldsList[ key ]; - } - } ); // Filter bindings to only show bindable attributes and remove pattern overrides. const { bindings } = metadata || {}; const filteredBindings = { ...bindings };