a-color-picker icon indicating copy to clipboard operation
a-color-picker copied to clipboard

All palette updates add an additional addColor listener

Open cloutsocks opened this issue 6 years ago • 2 comments
trafficstars

Fantastic plug-in!

I have only two small issues. Whenever I use picker.palette = <blah>, it seems setPalette creates listeners each time anew. So every time I change the stock palettes in the picker, more and more duplicated listeners get added.

Similarly, is there a way to disable the default actions for adding and removing?

cloutsocks avatar Nov 05 '19 01:11 cloutsocks

Some more info: I think it was assumed resetting innerHTML of this.paletteRow to '' would clear the event listener, but it doesn't. On my end, I've patched setPalette to not accept any argument, and to initialize paletteRow if it doesn't exist (as well as add the event listener)

I could issue a PR if it helps?

cloutsocks avatar Nov 05 '19 20:11 cloutsocks

Hi cloutsocks, could you create an npm package with your fixes?

jano-m avatar Dec 16 '20 21:12 jano-m