@@ -504,12 +504,13 @@ module.exports = React.createClass({
504504 onStart : emptyFunction ,
505505 onDrag : emptyFunction ,
506506 onStop : emptyFunction ,
507- onMouseDown : emptyFunction ,
507+ onMouseDown : emptyFunction
508508 } ;
509509 } ,
510510
511511 getInitialState : function ( props ) {
512512 // Handle call from CWRP
513+ var currentState = this . state ;
513514 props = props || this . props ;
514515 return {
515516 // Whether or not we are currently dragging.
@@ -521,9 +522,10 @@ module.exports = React.createClass({
521522 // Current transform x and y.
522523 clientX : props . start . x , clientY : props . start . y ,
523524
524- // Can only determine if is SVG after mounted
525- isElementSVG : false
526-
525+ // Determines if the element is an svg or not. Default to false.
526+ isElementSVG : currentState && currentState . isElementSVG !== undefined ?
527+ currentState . isElementSVG :
528+ false
527529 } ;
528530 } ,
529531
@@ -682,7 +684,7 @@ module.exports = React.createClass({
682684 // If the item you are dragging already has a transform set, wrap it in a <span> so <Draggable>
683685 // has a clean slate.
684686 var transform = this . state . isElementSVG ? null :
685- createCSSTransform ( {
687+ createCSSTransform ( {
686688 // Set left if horizontal drag is enabled
687689 x : canDragX ( this ) ?
688690 this . state . clientX :
@@ -695,6 +697,8 @@ module.exports = React.createClass({
695697 } ) ;
696698
697699
700+ // This is primarily for IE as it ignores the CSS transform applied above
701+ // and only respects the real transform attribute.
698702 var svgTransform = ! this . state . isElementSVG ? null :
699703 createSVGTransform ( {
700704 // Set left if horizontal drag is enabled
0 commit comments