-
Hi 👋 I'm currently using I checked the docs (notably sorting strategies) and the examples storybook and unless I'm mistaken virtualized grids don't seem to be supported out of the box. Did I miss anything? If not, would you have some pointers on how this could be implemented in userland? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
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 Having said that, you could fairly easily look at the source code of 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. |
Beta Was this translation helpful? Give feedback.
-
Actually, I have a virtualized grid implementation which works pretty well with This can probably be worked around by adding a timeout equivalent to the transition duration to ensure that the sortable item is visible until the |
Beta Was this translation helpful? Give feedback.
-
Any updates on this? I'm using rectSortingStrategy and haven't figured out a virtualized grid implementation. |
Beta Was this translation helpful? Give feedback.
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.