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 original element #94

Open
brianppoole opened this issue Aug 13, 2021 · 0 comments
Open

Drag original element #94

brianppoole opened this issue Aug 13, 2021 · 0 comments
Labels

Comments

@brianppoole
Copy link

brianppoole commented Aug 13, 2021

I'm developing an HTML5 game which features some drag and drop functionality.

Currently when dragging items I get a "ghosted" version of the item which isn't ideal. To make matters worse, each browser seems to have it's own way of rendering this -- Safari being the worst in that it will frequently cut off edges.

Is it possible to use the original DOM element? i.e. Can we bind the original element to the pointer and have it follow?

I'm thinking along the lines of:
onDragStart: track original coordinates; set position to absolute; apply offset;
onMouseMove: change absolute positioning offset;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant