diff --git a/packages/block-library/src/post-comments-count/edit.js b/packages/block-library/src/post-comments-count/edit.js index 2b3d3090824951..e5d0ec9352edaf 100644 --- a/packages/block-library/src/post-comments-count/edit.js +++ b/packages/block-library/src/post-comments-count/edit.js @@ -49,6 +49,14 @@ export default function PostCommentsCountEdit( { } ); }, [ postId ] ); + const hasPostAndComments = postId && commentsCount !== undefined; + const blockStyles = { + ...blockProps.style, + textDecoration: hasPostAndComments + ? blockProps.style?.textDecoration + : undefined, + }; + return ( <> @@ -59,8 +67,8 @@ export default function PostCommentsCountEdit( { } } /> -
- { postId && commentsCount !== undefined ? ( +
+ { hasPostAndComments ? ( commentsCount ) : (