From d15e01cd5d51abff55b1bfbe4b7e2420f354e1a1 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Thu, 26 Mar 2020 17:19:08 -0400 Subject: [PATCH] Annotations: Merge assigned block className with incoming prop (#21184) --- packages/annotations/src/block/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/annotations/src/block/index.js b/packages/annotations/src/block/index.js index c27c170b2d64a1..3a5dee89607abc 100644 --- a/packages/annotations/src/block/index.js +++ b/packages/annotations/src/block/index.js @@ -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 ); @@ -21,6 +21,8 @@ const addAnnotationClassName = ( OriginalComponent ) => { .map( ( annotation ) => { return 'is-annotated-by-' + annotation.source; } ) + .concat( className ) + .filter( Boolean ) .join( ' ' ), }; } )( OriginalComponent );