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

color-change event should return selected color

Open simonh1000 opened this issue 7 years ago • 0 comments

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

simonh1000 avatar Jul 03 '17 13:07 simonh1000