TanStackT
TanStack4y ago
5 replies
broad-emerald

virtual items are accordion

I'm struggling with this issue

the problem is:
I have a huge list of accordions. I need to virtualise them otherwise the browser struggle to handle that.

My problem is that whenever I open an accordion this happens.

I have also tried to virtualItem.measureElement(ref);
whenever the accordion is open or cloesed but nothing change.
any idea?

here is how i instanciate the list
  const virtualizer = useVirtualizer({
    getScrollElement: () => containerRef.current,
    estimateSize: () => 40,
    count: filteredOptions.length,
    overscan: 5
  });
Screenshot_2022-11-14_at_17.51.23.png
Was this page helpful?