From SVG 1.1 specs event.target refer to the instance in the shadow tree. In SVG 2.0 it refer to the SVGUseElement
- Edge 12-15: SVG 1.1
- IE 8-11: SVG 1.1
- Firefox: SVG 2.0
- Chrome: SVG 2.0
Polyfill:
// Polyfill for IE10+ and Edge
if (window.SVGElementInstance) {
// There is a false positive for Firefox where SVGElementInstance exist, but not used for event.target
var desc = Object.getOwnPropertyDescriptor(Event.prototype, "target");// some browsers (Android stock browser) return null for property descriptor of Event.prototype.target. Use non-standard property Event.prototype.srcElement instead
Object.defineProperty(Event.prototype, "target", {
configurable: true,
get: desc ? function() {
var target = desc.get.call(this);
return target && target.correspondingUseElement || target;
} : function() {
var target = this.srcElement;
return target && target.correspondingUseElement || target;
}
});
}
Or use event.target.correspondingUseElement instead of just event.target
From SVG 1.1 specs
event.targetrefer to the instance in the shadow tree. In SVG 2.0 it refer to theSVGUseElementPolyfill:
Or use
event.target.correspondingUseElementinstead of justevent.target<use>element are not caught jquery/jquery#3877 (comment)