reactjsprimereact

Virtualization doesn't work in PrimeReact's ListBox


Versions:


I've added a component like this:

<ListBox
   filter
   multiple
   value={myValue}
   options={myObjects}
   onChange={handleOnChange}
   optionLabel="name"
   optionValue="id"
   listStyle={{ height: 200 }}
   virtualScrollerOptions={{ itemSize: 30 }}
/>

If I get rid of virtualScrollerOptions it is rendered ok (without virtualization ofc). But if I add anything to virtualScrollerOptions the component becomes empty:
ListBox buggy view

What can I do to fix that?


Solution

  • Seems like a library bug. That's the same behavior as in the PrimeReact docs.

    https://primereact.org/listbox/#virtualscroll