Fix bug with window scroll container#806
Fix bug with window scroll container#806akhmadullin wants to merge 3 commits intoclauderic:masterfrom
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 70b02b4:
|
|
@akhmadullin , I want to fix this in my implementation, I don't know when this PR will be merged. |
|
@lavish0000, unfortunately, I don't. I didn't find solution, that could fix this behavior and could be implemented directly in project, that uses The only solution, that I found - fix behavior inside @clauderic (author of the lib) direct all development efforts towards new lib - @dnd-kit, but maybe he will find some time to review this PR. |
|
OK, Got it. Thanks @akhmadullin for the reply. |
Problem
There were some issues about incorrect sorting behavior in grid list with enabled
useWindowAsScrollContainer, for example, #577.When prop
useWindowAsScrollContaineris set totrue, sorting in grid list does not work properly:useWindowAsScrollContainer.bug.mp4
Solution
Such behavior is caused because of using root
htmlelement as scrolling container. Scrolling container's width is used for counting of new coordinates of list item during sorting.htmlelement has width much more, than grid list container element, new coordinates counts wrong, that's why we can see incorrect sorting behavior.This PR fixes issue with incorrect sorting by using width of grid container instead of using width of
htmlelement, where it's needed.The result of this fix:
useWindowAsScrollContainer.bug.fixed.mp4