taye / interact.js

JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)
http://interactjs.io/
MIT License
12.38k stars 785 forks source link

Can't drag element after resize (svg) #202

Closed ManelHachani closed 9 years ago

ManelHachani commented 9 years ago

Hello, I want to thank you for this amazing library. I intend to use interact.js for a new project with SVG elements , in order to be able to drag and resize Svgs but i faced some problems. I used the same code here. When i drag the element then resize it, it stuck at resize event and can't drag it anymore ,even the move cursor won't show up . So i searched for a solution in Google but i found nothing unfortunately ... I tried to change some code ... but nothing worked :( Here a demo

Please any help will be appreciated. Sorry for my english :d and thanks in advance.

taye commented 9 years ago

The code from the resizing demo on the homepage can only work for HTML elements. You need to change the resizemove listener function so that instead of changing target.style.width/height it changes the width and height attributes of the <rect> element (not the <g> element) in your demo.