Asked By: Anonymous
Is there a method for binding events to SVG elements like path using Svelte?
I have tried using on:hover on a path element and there is no effect.
Solution
Answered By: Anonymous
There is no “hover” event, Javascript has “onmouseover” and “onmouseout”.
so in svelte you would use on:mouseover={handleMouseOver}
.
Here is a link to a svelte example with svg:
https://svelte.dev/repl/170a4929993247aba2b16f18621729ab?version=3.23.2