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

Dnd drag cursor position (dragImage offset) is calculated incorrectly when using drag_handler #119

Open
vincentole opened this issue Aug 23, 2022 · 0 comments

Comments

@vincentole
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
If possible please provide a StackBlitz based on this template
https://stackblitz.com/edit/ngx-drag-drop-issue-template-kgmw6q?file=src/app/app.component.html

Steps to reproduce the behavior:
2. Click on 'Handle'
3. Drag card down
4. See that the cursor position is not correct and the dragImage 'jumps'

Expected behavior
I would expect that the cursor would be exactly at the position on the drag handle when I drag the image.

The problem seems to be the default function for calculating the offset.
I tried to adjust the function, there always seems to be a glitch issue / bug so that the correct position could not be determined.

export function calculateDragImageOffset( event:DragEvent, dragImage:Element ):{ x:number, y:number } {

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome
  • Version 104.0.5112.101 (Official Build) (arm64)
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

1 participant