Fixed position on command when filtering
This commit is contained in:
parent
ea211060b3
commit
ca460443d1
2 changed files with 10 additions and 4 deletions
|
|
@ -586,13 +586,14 @@ export default function ParameterComponent({
|
||||||
optionsIcon="Globe"
|
optionsIcon="Globe"
|
||||||
optionsButton={
|
optionsButton={
|
||||||
<AddNewVariableButton>
|
<AddNewVariableButton>
|
||||||
<CommandItem>
|
<CommandItem value="doNotFilter-addNewVariable">
|
||||||
<IconComponent
|
<IconComponent
|
||||||
name="Plus"
|
name="Plus"
|
||||||
className={cn("mr-2 h-4 w-4 text-primary")}
|
className={cn("mr-2 h-4 w-4 text-primary")}
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
/>
|
/>
|
||||||
Add New Variable
|
<span>Add New Variable</span>
|
||||||
|
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
</AddNewVariableButton>
|
</AddNewVariableButton>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,10 +136,15 @@ export default function InputComponent({
|
||||||
side="bottom"
|
side="bottom"
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
<Command>
|
<Command
|
||||||
|
filter={(value, search) => {
|
||||||
|
if (value.includes(search) || value.includes("doNotFilter-"))
|
||||||
|
return 1; // ensures items arent filtered
|
||||||
|
return 0;
|
||||||
|
}}
|
||||||
|
>
|
||||||
<CommandInput placeholder={optionsPlaceholder} />
|
<CommandInput placeholder={optionsPlaceholder} />
|
||||||
<CommandList>
|
<CommandList>
|
||||||
<CommandEmpty>No results found.</CommandEmpty>
|
|
||||||
<CommandGroup defaultChecked={false}>
|
<CommandGroup defaultChecked={false}>
|
||||||
{options.map((option, id) => (
|
{options.map((option, id) => (
|
||||||
<CommandItem
|
<CommandItem
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue