Skip to content

Commit

Permalink
Respect clearable setting to display the reset button.
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfra committed Dec 20, 2024
1 parent 80e7dac commit 35ba742
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const renderToggle =
( settings ) =>
( { onToggle, isOpen } ) => {
const {
clearable,
colorValue,
gradientValue,
onColorChange,
Expand Down Expand Up @@ -120,7 +121,7 @@ const renderToggle =
label={ label }
/>
</Button>
{ value && (
{ clearable && value && (
<Button
__next40pxDefaultSize
label={ __( 'Reset' ) }
Expand Down Expand Up @@ -187,6 +188,7 @@ export default function ColorGradientSettingsDropdown( {
...setting,
};
const toggleSettings = {
clearable: controlProps.clearable,
label: setting.label,
colorValue: setting.colorValue,
gradientValue: setting.gradientValue,
Expand Down

0 comments on commit 35ba742

Please sign in to comment.