Skip to content

Is there a built-in sorting strategy for virtualized grids in @dnd-kit/sortable? #411

Answered by clauderic
kombucha asked this question in Q&A
Discussion options

You must be logged in to vote

That's right, virtualized grids aren't currently supported by any of the sorting strategies. It's been a while since I looked at this, but I believe the rectSortingStrategy strategy needs all elements to be mounted to work properly.

Having said that, you could fairly easily look at the source code of react-sortable-hoc's grid sorting logic and port it over as a custom sorting strategy for @dnd-kit:

https://github.com/clauderic/react-sortable-hoc/blob/master/src/SortableContainer/index.js#L711-L788

This isn't a feature I need so I won't be prioritizing it myself for the time being. Would happily accept a PR request for @dnd-kit if anyone tackles this.

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@michaeled
Comment options

@tomasmenezes
Comment options

@hsavit1
Comment options

@hsavit1
Comment options

Answer selected by clauderic
Comment options

You must be logged in to vote
2 replies
@taiwanhua
Comment options

@taiwanhua
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
8 participants