Replies: 2 comments 2 replies
-
I've worked a lot with virtualized lists, and in my experience the performance is actually worse when using That said, you could easily fork |
Beta Was this translation helpful? Give feedback.
-
For other people interested in doing this it is possible. You can follow the pattern from css.ts to build your transform and then you need to set the import {getClientRect} from "@dnd-kit/core"
<DndContext measuring={{
droppable: {
measure: getClientRect,
},
draggable: {
measure: getClientRect,
},
dragOverlay: {
measure: getClientRect,
},
}}> The library defaults to transform agnostic rects which is why out of the box manipulating the transform on your own does not work. Once you set measure correctly, as long as your transform is also set correctly, everything should work. One last gotcha, in the dragOverlay you do not want to apply the offset from your virtualized list. Hopefully that helps other people who had this issue. |
Beta Was this translation helpful? Give feedback.
-
Hi! Is there a way to modify the virtualized story on the storybook to render the items without the
top
style property thatreact-tiny-virtual-list
provides? I am trying to replacetop: ${start}px
withtransform: translateY(${start}px)
or something similar, since I've read that usingtransform
is actually more performance-friendly than usingtop
.I've been trying to do it without any luck, could you point me in the right direction?
Beta Was this translation helpful? Give feedback.
All reactions