We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{results.map((result) => ( <Command.Item key={result.id}>{result.label}</Fragment> )} <Command.Separator alwaysRender={results.length > 0} /> <Command.Item value={query} onSelect={() => add(query)}> Add “{query}” </Command.Item>
The separator element always appears at the top of the list for some reason, regardless of where it is in the source.
The text was updated successfully, but these errors were encountered:
Are you manually filtering the results and using <Command shouldFilter={false}>? This works fine:
<Command shouldFilter={false}>
const [query, setQuery] = useState(''); const filteredResults = useMemo( () => query.length === 0 ? results : results.filter((result) => { return result.label .toLowerCase() .includes(query.toLowerCase()); }), [query] ); return ( <Command shouldFilter={false}> <Command.Input value={query} onValueChange={setQuery} /> <Command.List> <Command.Group> {filteredResults.map((result) => ( <Command.Item key={result.id}> {result.label} </Command.Item> ))} <Command.Separator alwaysRender={filteredResults.length > 0} /> <Command.Item value={query}>Add “{query}”</Command.Item> </Command.Group> </Command.List> </Command> );
Sorry, something went wrong.
No branches or pull requests
The separator element always appears at the top of the list for some reason, regardless of where it is in the source.
The text was updated successfully, but these errors were encountered: