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

CSS transform on dragged element is not preserved by the dragged item #129

Open
ericbiewener opened this issue Sep 24, 2024 · 3 comments
Open

Comments

@ericbiewener
Copy link

Screenshot 2024-09-24 at 6 27 25 AM

This appears to be a limitation of the HTML5 drag & drop API (Codepen indicating this), so feel free to close this issue if pragmatic doesn't offer a solution. Posting this in part just to have it discoverable by future devs.

One potential solution is of course to make a wrapping container draggable, rather than the transformed element itself. But this produces other visual issues, such as the clipping are on the dragged item including an opaque gray background, and potentially even some content outside the DOM of the dragged element (note the few pixels of purple on the left):

Screenshot 2024-09-24 at 6 42 40 AM
@EarlStrada
Copy link

EarlStrada commented Sep 25, 2024

I am also experiencing this issue and only on chrome.
Screenshot 2024-09-25 at 10 42 28 AM

@tarun111111
Copy link

Than use the shadow border usess to fix them

@alexreardon
Copy link
Collaborator

  • unfortunately, there are some known bugs with native drag previews (elements with transforms being one of them). The issue with transforms seems to impact Safari the most, so one option is to use the transform on Chrome, and disable the transform in onGenerateDragPreview for Safari
  • setCustomNativeDragPreview helps smooth over most issues if you haven't tried that

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

4 participants