Skip to content

Commit

Permalink
Merge cc3545e into aef276c
Browse files Browse the repository at this point in the history
  • Loading branch information
emeaguiar committed Jul 12, 2022
2 parents aef276c + cc3545e commit 7ad786c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ const ColorControl = ( { defaultValue, params, onColorChange, mode } ) => {
};

useEffect( () => {
if ( ! color ) {
return;
}

let hexColor = color.substring( 1 );

if ( hexColor.length === 3 ) {
Expand Down Expand Up @@ -179,7 +183,7 @@ const ColorControl = ( { defaultValue, params, onColorChange, mode } ) => {
<MaterialColorPalette
value={ color }
onChange={ value => {
onChange( value );
onChange( value ?? defaultValue );
} }
materialColorsOnly={ true }
/>
Expand Down

0 comments on commit 7ad786c

Please sign in to comment.