Delegated event not firing for click within SVG use element
|Reported by:||dankellett||Owned by:||gibson042|
I have created a jsbin illustrating the potential bug. http://jsbin.com/welcome/71517/
The first js statement attaches an event using the 'live' functionality of the .on() method. This event does not fire when you click on the chart image, but will fire when you click on the SVG outside of the graph image. The event will write 'live click' to the console.
The second statement attaches an event using a regular direct event attachment to the svg container. This does work when you click on the chart and elsewhere in the SVG. The event will write 'on click' to the console.
I would expect that the two event handlers would fire no matter where you click within the SVG. The difference being that the 'live' type attachment would allow me to detach and reattach a new SVG target to the DOM without having to reattach the event handler.
Change History (12)
comment:2 Changed 4 years ago by dmethvin
- Cc gibson042 timmywil added
- Component changed from unfiled to event
- Milestone changed from None to 1.9
- Priority changed from undecided to low
- Status changed from new to open
comment:4 Changed 4 years ago by dmethvin
- Owner set to dmethvin
- Status changed from open to assigned
comment:10 Changed 4 years ago by Richard Gibson
- Resolution set to fixed
- Status changed from assigned to closed