Skip to content

Commit

Permalink
Revert "Add general override for accessibility label"
Browse files Browse the repository at this point in the history
This reverts commit 0864919.
  • Loading branch information
artemiomorales committed Sep 10, 2024
1 parent 0864919 commit 565b179
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions packages/block-editor/src/hooks/use-bindings-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function getBindableAttributes( blockName ) {
return BLOCK_BINDINGS_ALLOWED_BLOCKS[ blockName ];
}

export const editWithBlockBindings = createHigherOrderComponent(
export const withBlockBindingSupport = createHigherOrderComponent(
( BlockEdit ) => ( props ) => {
const registry = useRegistry();
const blockContext = useContext( BlockContext );
Expand Down Expand Up @@ -296,18 +296,9 @@ export const editWithBlockBindings = createHigherOrderComponent(
</>
);
},
'editWithBlockBindings'
'withBlockBindingSupport'
);

function labelWithBlockBindings( settings ) {
return ( attributes, { context } ) => {
if ( attributes?.metadata?.bindings && context === 'accessibility' ) {
return 'Overriding label';
}
return settings.__experimentalLabel?.( attributes, { context } );
};
}

/**
* Filters a registered block's settings to enhance a block's `edit` component
* to upgrade bound attributes.
Expand All @@ -323,8 +314,7 @@ function shimAttributeSource( settings, name ) {

return {
...settings,
edit: editWithBlockBindings( settings.edit ),
__experimentalLabel: labelWithBlockBindings( settings ),
edit: withBlockBindingSupport( settings.edit ),
};
}

Expand Down

0 comments on commit 565b179

Please sign in to comment.