Virtualization
By default, react-tree-multi-select uses virtualization to render items efficiently.
Virtualization helps improve performance by only rendering the visible portion of a large list,
which makes it the recommended choice in most cases.
The following example demonstrates the component rendering a large number of nodes with virtualization enabled.
Disabling Virtualization
You can disable virtualization by passing the isVirtualized={false} prop.
A common reason to do this is when you want the dropdown width to automatically adjust to the size of its content.
Virtualization uses absolute positioning for list items and only renders a subset of them at a time,
which prevents the dropdown from resizing based on its full content.
To disable virtualization and make the dropdown adjust its width automatically:
- Pass
isVirtualized={false}to your component. - Add
width: autoto the.rtms-dropdownclass in your styles.
Only disable virtualization if you have a relatively small number of items, since rendering all items at once can reduce performance.
This example demonstrates the component when virtualization is disabled, allowing the dropdown to resize automatically.