Open inokawa opened 10 months ago
As a workaround, you can override item
prop of Virtualizer
and use React.cloneElement
in it.
https://github.com/inokawa/virtua/blob/main/stories/react/advanced/With%20cmdk.stories.tsx
It may be better to add a shorthand like <Virtualizer item={false}>
. As an important point, without wrapper div, ResizeObserver doesn't detect border by default, and margin at all. We have to change configuration for it.
Hi! Been struggling to find any list-virtualization plugin that allows this, so it'd be fantastic if virtua did. You mention that you can overwrite the item
prop on Virtualizer in React - is there a similar workaround for ListItem
in the Vue implementation?
Hello @wanecek ,
Vue Virtualizer doesn't have item
prop yet but it would be possible to implement the feature.
Currently I don't have time to do it, but contribution is welcome if anyone want to help.
React 19 will have ref cleanup function. I'll try it after release.
However, in current architecture, we can't assign ResizeObserver and position to items without it.