Problem with 'onclick' on SVG elements
See original GitHub issueI’m building an SPA that shall make extensive use of SVG. This far I have not been able to get any form of ‘onclick’ working on my SVG elements. I have tried both $onclick="test"
and onclick={e => this.run("test", e)}
, in elements like these:
<circle cx={cx} cy={cy} r={rad} $onclick="test"/>
<rect x="8" y="8" width="90" height="90" stroke="blue" onclick={e => this.run("test", e)}/>
This, however, works fine: <h1 onclick={e => this.run("test", e)}>TEST</h1>
I’m using apprun 2.23.12. Is this a bug?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Making an svg image object clickable with onclick, avoiding ...
Click on SVG's <g> element in <object> with click event. Works 100% ...
Read more >onclick - SVG: Scalable Vector Graphics - MDN Web Docs
The onclick attribute specifies some script to run when the element is clicked. You can use this attribute with the following SVG elements:....
Read more >SVG with OnClick JS Function Calls - YouTube
Lets create a quick SVG with the free online Method Draw editor, ... add in a few Javascript functions that are called when...
Read more >HTML : Add onclick event to SVG element - YouTube
HTML : Add onclick event to SVG element [ Gift : Animated Search Engine ... If there any issues, contact us on -...
Read more >SVG - Interactivity - Tutorialspoint
SVG elements support mouse events, keyboard events. We've used onClick event to call a javascript functions. In javascript functions, document represents SVG ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It is now fixed in v2.23.13. I also added it as an example in the playground. https://apprun.js.org/#play/23
I see. Then it appears to be a bug. Will fix it.
On Mon, Apr 13, 2020 at 4:16 PM Jon Kleiser notifications@github.com wrote: