Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

color-change event should return selected color #1

Open
simonh1000 opened this issue Jul 3, 2017 · 0 comments
Open

color-change event should return selected color #1

simonh1000 opened this issue Jul 3, 2017 · 0 comments

Comments

@simonh1000
Copy link

simonh1000 commented Jul 3, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant