{
- onChange( isSelected ? undefined : colors );
- } }
- />
- );
- } ) }
+ options={ [ disableOption, ...options ] }
actions={
- onChange( undefined ) }
- >
- { __( 'Clear' ) }
-
+
+ onChange( undefined ) }
+ >
+ { __( 'Clear' ) }
+
+
}
>
{ ! disableCustomColors && ! disableCustomDuotone && (
diff --git a/packages/components/src/duotone-picker/duotone-swatch.js b/packages/components/src/duotone-picker/duotone-swatch.js
index 1ab35b53034c7d..7e89ef2cc58172 100644
--- a/packages/components/src/duotone-picker/duotone-swatch.js
+++ b/packages/components/src/duotone-picker/duotone-swatch.js
@@ -6,6 +6,10 @@ import Swatch from '../swatch';
import { getGradientFromCSSColors } from './utils';
function DuotoneSwatch( { values } ) {
+ if ( typeof values === 'string' ) {
+ return ;
+ }
+
return (
( {
position: ( i * 100 ) / ( colors.length - 1 ),
color,