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

Target area is off based on dragstart position #65

Closed
ghost opened this issue Oct 28, 2019 · 1 comment
Closed

Target area is off based on dragstart position #65

ghost opened this issue Oct 28, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 28, 2019

I noticed a weird issue which I'm gonna try to describe in the following.

When user starts dragging in the middle of a card, everything seems fine:

Normal behavior

works

The issue

However, if I start dragging at the very left or right edge of a card suddenly the drop area is very off, see:

works-not

You can see that after entering the right half of the target area smooth-dnd suddenly doesn't recognise it any more. Also, if I keep moving further to the right the cards in the next lange already start moving even if I haven't entered the lane yet.

Any way to fix this?

@ghost ghost changed the title Target area differs based on where dragstart on a card starts Target area off based on dragstart position Oct 28, 2019
@ghost ghost changed the title Target area off based on dragstart position Target Area is Off Based on Dragstart Position Oct 28, 2019
@ghost ghost changed the title Target Area is Off Based on Dragstart Position Target area is off based on dragstart position Oct 31, 2019
@ghost
Copy link
Author

ghost commented Nov 3, 2019

I was able to fix this bug by changing the following line 214 in container.ts:

let hitElement = document.elementFromPoint(draggableInfo.position.x, draggableInfo.position.y);

to this:

let hitElement = document.elementFromPoint(draggableInfo.mousePosition.x, draggableInfo.mousePosition.y);

@ghost ghost closed this as completed Nov 3, 2019
This issue was closed.
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

0 participants