mdbassit / Coloris

A lightweight and elegant JavaScript color picker. Written in vanilla ES6, no dependencies. Accessible.
https://coloris.js.org/examples.html
MIT License
443 stars 58 forks source link

能增加一个onClose事件监听吗? #116

Closed 978165754 closed 1 year ago

978165754 commented 1 year ago

你好,我只看到了onChange事件监听,但我只想等关闭面板的时候执行某个事件,而不是每次改变颜色都执行,如果能加一个onClose来监听关闭了颜色面板就好了

onClose :(color, input)=>{
    console.log('color, input: ', color, input);
}
mdbassit commented 1 year ago

You can listen for a close event on the input field.

myColorField.addEventListener('close', event => {
    // Do something when the color picker is closed
});