color-picker
color-picker copied to clipboard
color-change event should return selected color
I think in general events should contain a value, but in my case it is really necessary as I use Elm and all the querySelector business is not that obvious. I have made some progress by using this instead
const fireEvent = host => {
var evt = new CustomEvent("color-change", {detail: {hex: host.state.hex}});
// host.dispatchEvent(new Event("color-change", {
// bubbles: true,
// composed: true,
// hex: host.state.hex
// }));
host.dispatchEvent(evt);
}
wrapping the value with "hex" and then "detail" was necessary and did not work with just one layer of wrapping. Not sure why though