-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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
- No direct link to event target when SVG <use> is used - Microsoft Edge Development
- https://chromium.googlesource.com/chromium/blink.git/+/2b7c1a912916f9dc3b83b1d84cbcce477b0e931a/LayoutTests/svg/custom/use-instanceRoot-as-event-target.xhtml
- https://bugs.jquery.com/ticket/13180 and delegated Mouse Event targeted on SVG
<use>element are not caught jquery/jquery#3877 (comment) - https://groups.google.com/a/chromium.org/forum/#!topic/chromium-bugs/AeSY6qzKm4E
- SVGElementInstance object (Internet Explorer)
- 265895 - Support SVGElementInstance event delivery for <svg:use>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels