Skip to content

Commit

Permalink
Hide prefix and suffix in post terms (#42418)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Lende authored Jul 20, 2022
1 parent 6133a21 commit 80c536c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/block-library/src/post-terms/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default function PostTermsEdit( {
attributes,
clientId,
context,
isSelected,
setAttributes,
insertBlocksAfter,
} ) {
Expand Down Expand Up @@ -96,7 +97,7 @@ export default function PostTermsEdit( {
</InspectorControls>
<div { ...blockProps }>
{ isLoading && <Spinner /> }
{ ! isLoading && hasPostTerms && (
{ ! isLoading && hasPostTerms && ( isSelected || prefix ) && (
<RichText
allowedFormats={ ALLOWED_FORMATS }
className="wp-block-post-terms__prefix"
Expand Down Expand Up @@ -135,7 +136,7 @@ export default function PostTermsEdit( {
! hasPostTerms &&
( selectedTerm?.labels?.no_terms ||
__( 'Term items not found.' ) ) }
{ ! isLoading && hasPostTerms && (
{ ! isLoading && hasPostTerms && ( isSelected || suffix ) && (
<RichText
allowedFormats={ ALLOWED_FORMATS }
className="wp-block-post-terms__suffix"
Expand Down

0 comments on commit 80c536c

Please sign in to comment.