I'm trying to virtualize cmdk using the react-window package. This works fine (see the "virtualized cmdk without autosize" demo). All of the elements are displayed properly. When FixedSizeList is used, I need to set the items to take up a certain height. If there are too few items, empty space will be rendered.
One fix for this is to use [react-virtualized-auto-sizer] (https://github.com/bvaughn/react-virtualized-auto-sizer), which will dynamically change the height. However, this causes the <Command.Item /> elements to no longer render, and instead the <Command.Empty /> element is shown. The "virtualized cmdk with autosize" demo shows "no items found".
Here's a CodeSandbox that demonstrates the issue.
I'm trying to virtualize
cmdk
using the react-window package. This works fine (see the "virtualized cmdk without autosize" demo). All of the elements are displayed properly. WhenFixedSizeList
is used, I need to set the items to take up a certain height. If there are too few items, empty space will be rendered.One fix for this is to use [react-virtualized-auto-sizer] (https://github.com/bvaughn/react-virtualized-auto-sizer), which will dynamically change the height. However, this causes the
<Command.Item />
elements to no longer render, and instead the<Command.Empty />
element is shown. The "virtualized cmdk with autosize" demo shows "no items found".