-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Svelte this click events #3050
Comments
Use e.target (e.currentTarget) rather than |
This is quite weird actually, can you reproduce this in a REPL? Inline arrow function event handlers get compiled to normal functions in Svelte, not arrow functions (see this REPL, look for As @qutran said, the solution is to use |
|
@Leschonander if ok please close the issue. |
I'm playing around with d3 and Svelte, using the
d3-geo
package to create maps.When doing click events,
this
returns{d: {…}, i: number}
and not thepath
as one would might expect. With Svelte, how would one access thepath
then? Does it have to do with the fact that the script is first, and the the HTML + markup after that is causing problems?On the bright side, like in react, doing events like this
n:click={() => clickedState(d)}
works.The text was updated successfully, but these errors were encountered: