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

Issue with Sorting Items in Flex-Wrap Container Using DndKit's rectSortingStrategy and closestCenter Collision Detection #1595

Open
Konstantinacc opened this issue Jan 28, 2025 · 0 comments

Comments

@Konstantinacc
Copy link

I encounter an issue when sorting elements within a div that uses the flex-wrap class. I am utilizing rectSortingStrategy in strategy property of SortableContextand closestCenter in collisionDetection property of DndContext.

The relevant code can be found here for reference.

The issue arises when attempting to drag the "Age" element next to the space of the "Telephone Number" element. Instead of being placed after "Telephone Number", it is positioned before it. To achieve the intended behavior, the "Age" item needs to be placed in front of the "Description" item, after which it will display correctly next to "Telephone Number".

Image

A similar issue occurs when attempting to move the "Name" element to the end of the list, after the "Information" item.

Image

Any assistance or guidance on resolving this issue would be greatly appreciated.

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