Open tarngerine opened 1 year ago
OK I guess i didn't need to dynamically change Command.Item value if I'm doing custom filtering anyway... :D
but I think if you set shouldFilter={false} it shouldnt run command-score, no?
I also ran into this when rendering a dynamic Command.Item which matched the input value:
<Command.Item value={inputValue} />
Even with filtering={false}
the custom filtering continued to run and drop frames.
As @tarngerine said, provide a custom filter function to work around it. e.g:
<CommandPrimitive shouldFilter={false} filter={() => 1} />
I saw in one of the threads to support an always-present item like "New item" in a list of items, to use
<Command.Item value={inputValue} />
so it's always in the filtered + ranked listHowever, the default computation gets very slow with long inputs as you type more and more
Repro: https://codesandbox.io/s/xenodochial-poitras-d6nn6s?file=/src/App.tsx
Note this still happens even if you set
shouldFilter = false
It's circumventable if you provide a custom filter function, though! So I am not blocked