Open mattheu opened 8 years ago
Has there been any development with this? I'm using 2 pickers to create a background gradient. When a color is chosen in either of the pickers the change callback gets the values of the 2 pickers to create a linear-gradient css rule. It all works fine until you try to clear either of them. Obviously the change callback is not fired. Just wondering if anyone has manage to find a work around?
2021 and still nothing on this?
Here's a hack for the time being.
var added_clearer = false;
$('.color-field').wpColorPicker({
change: function(){
if ( ! added_clearer ) {
$('.wp-picker-clear').on('click', function(){
$(this).parent('.wp-picker-input-wrap').find('.color-field').change();
});
added_clearer = true;
}
}
});
If I have already set the colour, but I want to remove it later, I cannot as it does not trigger a change event.
Related to https://github.com/Automattic/Iris/issues/53