Commit 17cc510
committed
Fix drag behavior on for <svg:use> elements
Drag behavior is broken for <svg:use> elements on certain
browsers. This includes d3.layout.force(...).drag()
On browsers like Internet Explorer 11, the <svg:use>
EventTarget is represented by a SVGElementInstance that looks
like this:
[object SVGElementInstance]
{
[functions]: ,
__proto__: { },
childNodes: { },
constructor: { },
correspondingElement: { },
correspondingUseElement: { },
firstChild: null,
lastChild: null,
nextSibling: null,
parentNode: { },
previousSibling: { }
}
No other properties such as .style are present. We must use the
correspondingElement property to access the actual SVG element
instantiated by the <svg:use> in order to have a successful drag.1 parent 9f96bf5 commit 17cc510
3 files changed
+7
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1204 | 1204 | | |
1205 | 1205 | | |
1206 | 1206 | | |
1207 | | - | |
| 1207 | + | |
1208 | 1208 | | |
1209 | 1209 | | |
1210 | 1210 | | |
| |||
0 commit comments