web-padawan / vanilla-colorful

A tiny color picker custom element for modern web apps (2.7 KB) 🎨
https://web-padawan.github.io/vanilla-colorful/
MIT License
784 stars 29 forks source link

refactor!: do not fire event on setting color #72

Closed web-padawan closed 2 years ago

web-padawan commented 2 years ago

This is a breaking change aiming to align the implementation with Custom Elements best practices:

Dispatching an event in response to a host setting a property is superfluous (the host knows the current state because it just set it). Dispatching events in response to a host setting a property may cause infinite loops with data binding systems.

From now on, color-changed event is only fired when color is picked by the user. It will NOT be fired on setting color as a property or attribute on the component.

Fixes #64 Closes #70