Skip to content

Commit

Permalink
Format Library: Fix logic on hasColorsToChoose (#65530)
Browse files Browse the repository at this point in the history
Previous logic showed unusable Highlight format when palette was empty and custom was disabled, and hid it when custom was enabled but palette was empty.

Co-authored-by: dougwollison <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
3 people authored Nov 23, 2024
1 parent cbbb848 commit 326589d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/format-library/src/text-color/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function TextColorEdit( {
[ contentRef, value, colors ]
);

const hasColorsToChoose = colors.length || ! allowCustomControl;
const hasColorsToChoose = !! colors.length || allowCustomControl;
if ( ! hasColorsToChoose && ! isActive ) {
return null;
}
Expand Down

0 comments on commit 326589d

Please sign in to comment.