Skip to content

Commit

Permalink
Annotations: Merge assigned block className with incoming prop (#21184)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored and jorgefilipecosta committed Mar 27, 2020
1 parent 304a5f0 commit d15e01c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/annotations/src/block/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { withSelect } from '@wordpress/data';
* @return {Object} The enhanced component.
*/
const addAnnotationClassName = ( OriginalComponent ) => {
return withSelect( ( select, { clientId } ) => {
return withSelect( ( select, { clientId, className } ) => {
const annotations = select(
'core/annotations'
).__experimentalGetAnnotationsForBlock( clientId );
Expand All @@ -21,6 +21,8 @@ const addAnnotationClassName = ( OriginalComponent ) => {
.map( ( annotation ) => {
return 'is-annotated-by-' + annotation.source;
} )
.concat( className )
.filter( Boolean )
.join( ' ' ),
};
} )( OriginalComponent );
Expand Down

0 comments on commit d15e01c

Please sign in to comment.