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

DragOverlay incorrect position when container is scrolled through code #463

Open
olee opened this issue Sep 29, 2021 · 2 comments
Open

DragOverlay incorrect position when container is scrolled through code #463

olee opened this issue Sep 29, 2021 · 2 comments

Comments

@olee
Copy link

olee commented Sep 29, 2021

I have a component where the scrollable container has overflow: hidden, because its scroll position is controlled through code.
I need this because I have a virtualized table, where the header is a separate element of which the scroll position is synchronized with the body of the table through events.

This makes the position of the DragOverlay broken like this, as soon as the table is scrolled horizontally.

Unscrolled:
image

Scrolled:
image

Is there any solution to this?
From debugging the code I noticed that getViewRect is the function which determines the position of the element on the screen with the scroll offsets correctly but it is failing because of missing overflow property on the header container.
Why couldn't the code use getBoundingClientRect instead?

The weird thing is that the drag position seems to be actually determined correctly (the element is sorted into the position where the mouse cursor is), but ONLY the drag overlay is broken which tells me that dnd-kit should be able to handle this correctly.

@baptisteArno
Copy link

I probably have the same issue:

CleanShot.2021-11-20.at.10.07.37.mp4

Any work around @olee ?

@baptisteArno
Copy link

#464 is probably a related issue

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