Skip to content
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

drag: clone element doesn't respect transform: translate #269

Closed
martonp96 opened this issue Jan 20, 2022 · 3 comments
Closed

drag: clone element doesn't respect transform: translate #269

martonp96 opened this issue Jan 20, 2022 · 3 comments

Comments

@martonp96
Copy link

Hello,

When using transform: translate(50%,-50%); to center a div, the cloned element attached to the cursor appears on the wrong place, like the transform was not used on the item at all.

RML for testing: https://pastebin.com/CwtAPrnz

mikke89 added a commit that referenced this issue Jan 21, 2022
…nsforms, or when the cloned element uses auto- or percentage-margins. See #269.
@mikke89
Copy link
Owner

mikke89 commented Jan 21, 2022

Hi. Thanks again for the easy reproducible.

I've made a fix for this now. Of course, the situation becomes a bit unwieldy if you make more complex transforms with rotations and so on. We don't try to replicate such a complicated chain of transforms on the cloned element, instead, we only move it to the proper initial location. This approach solves the problem in you test.

I also discovered some issues with auto- and percentage-margins which should also be resolved.

@martonp96
Copy link
Author

@mikke89 thank you for the quick response, i will test them as soon as i have time.

@mikke89
Copy link
Owner

mikke89 commented Feb 4, 2022

Closing this now, considered fixed unless otherwise notified.

@mikke89 mikke89 closed this as completed Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants