Ennoriel / svelte-awesome-color-picker

svelte-awesome-color-picker is a highly customizable svelte color picker component library
https://svelte-awesome-color-picker.vercel.app
MIT License
128 stars 11 forks source link

Handler for on:blur? #79

Open keehun opened 2 months ago

keehun commented 2 months ago

I'm a very happy user of this component, and I would like to contribute an on:blur handler. Is this something that would be welcomed?

I need it for my project where on:input changes the color in a preview while I'd like to save/commit with something like on:blur. Before I submitted a pull request, I wanted to make sure it would be welcomed/reviewed.

While it is possible to bind:isOpen, that forces me to keep track of which color picker opened/closed elsewhere. Having this handling done at the place of component declaration could simplify certain use cases.

Thank you for this wonderful library!

Ennoriel commented 2 months ago

Thanks for your kind words about my library. :)

Go ahead with the feature, it's a really nice to have feature. ;)

I don't remember how this is done for on:input. Ideally it should fire the events from all the parts of the component.

I first thought that it should also work with the fallback HTML color input. However I don't think of a situation where a blur event would be useful if JavaScript broke!

Be noted that I won't be fast to review the PR (🏝️).