-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The element's original transform properties are discarded while dragging #92
Comments
Thanks for reporting this issue. It's certainly a bug, but hasn't been too big of an issue so far. Add a 👍 reaction to this issue if you would like to see this feature added. Do not add +1 comments — They will be deleted. |
I have the fix for this issue, and would like to push my fix? |
sure, let's take a look :) |
…ging (fix the issue desandro#92)
I tried it out. It seems to work.
Whilst it's being dragged around, the combined CSS becomes:
...etc. So the code does that it does but the dragging around of it is nuts. It just doesn't appear to work. |
…es are discarded
is this implemented yet?? i need this feature to implement scaling/zoom effect 😢 |
Related (perhaps) - on my implementation, when I click on an element with Script:
Styles:
|
👍 really need this! |
@desandro no considering to fix this?? |
In the "positionDrag" function, it replace the transform style with only translate(...) and in the "dragEnd" and "destroy" functions, it empties the transform style.
If the element previously has some transform styles, e.g. rotate, scale, they will be lost.
Please update the code like
In positionDrag, keep the original transform styles except translate:
var transform = this.element.style[ transformProperty ];
transform = transform.replace(/translate(3d)?(.*)/, '');
this.element.style[ transformProperty ] = transform + translate( this.dragPoint.x, this.dragPoint.y );
After drag, keep the original transform styles except translate
Thanks,
The text was updated successfully, but these errors were encountered: