From 326589db9246611cacbdc6065e80be75f72507e9 Mon Sep 17 00:00:00 2001 From: Doug Wollison Date: Sat, 23 Nov 2024 05:09:26 -0500 Subject: [PATCH] Format Library: Fix logic on hasColorsToChoose (#65530) 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 Co-authored-by: Mamaduka --- packages/format-library/src/text-color/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/format-library/src/text-color/index.js b/packages/format-library/src/text-color/index.js index 9d8241544760b..04fd8ee6ce55a 100644 --- a/packages/format-library/src/text-color/index.js +++ b/packages/format-library/src/text-color/index.js @@ -75,7 +75,7 @@ function TextColorEdit( { [ contentRef, value, colors ] ); - const hasColorsToChoose = colors.length || ! allowCustomControl; + const hasColorsToChoose = !! colors.length || allowCustomControl; if ( ! hasColorsToChoose && ! isActive ) { return null; }