TanStackT
TanStack3y ago
7 replies
progressive-amaranth

Virtual doesn't load items when displayed in a dialog

Hello everyone,

I'm working on a feature to show user's list of followers. Since I use shadcn I decided to display that list inside a dialog (https://ui.shadcn.com/docs/components/dialog ) and inside the dialog content to use @tanstack/virtual. However, when I open that dialog the items aren't displayed (height is calculated properly). Only when I switch the screen/tab I get the elements.

I've found this issue on github: https://github.com/TanStack/virtual/issues/263 however, using a ref callback din't help much.
You can see the behaviour on the provided video.

Relevant project info:
"next": "^13.5.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@tanstack/react-virtual": "^3.0.0-beta.65",
Was this page helpful?