Closed macbubi closed 3 years ago
was able to workaround using pickr.destroy() but the off method still not working
This is not how functions / callbacks work... You pass in a function and try to unbind an different function in your fiddle. You'll need to declare a function which you can bind and unbind.
Example:
pickr.on('change', console.log);
pickr.off('change', console.log);
or
const listener = () => console.logt('change!');
pickr.on('change', listener);
pickr.off('change', listener);
What is the current behavior?
We use this amazing color picker with custom events for 'clear', 'cancel', and 'change'. The problem is that the events are not unsubscribed using the off method (the callback doesnt being called at all)
Please provide the steps to reproduce and create a JSFiddle.
https://jsfiddle.net/2m7tzybc/7/
What is the expected behavior?
.off(event, cb) will remove the event listener and call the cb function
Your environment: