mirror of
https://github.com/ershisan99/www.git
synced 2025-12-17 21:09:22 +00:00
fix search
This commit is contained in:
@@ -52,8 +52,10 @@ function PlayerSelectorRaw({
|
|||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent className='w-[200px] p-0'>
|
<PopoverContent className='w-[200px] p-0'>
|
||||||
<Command
|
<Command
|
||||||
filter={(value, search) => {
|
filter={(value, search, keywords) => {
|
||||||
if (value.toLowerCase().includes(search.toLowerCase())) return 1
|
if (value.toLowerCase().includes(search.toLowerCase())) return 1
|
||||||
|
const name = keywords?.[0]
|
||||||
|
if (name?.toLowerCase().includes(search.toLowerCase())) return 1
|
||||||
return 0
|
return 0
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -65,6 +67,7 @@ function PlayerSelectorRaw({
|
|||||||
<CommandItem
|
<CommandItem
|
||||||
key={`${player.value}-2`}
|
key={`${player.value}-2`}
|
||||||
value={player.value}
|
value={player.value}
|
||||||
|
keywords={[player.label]}
|
||||||
onSelect={(currentValue) => {
|
onSelect={(currentValue) => {
|
||||||
onValueChange(currentValue === value ? '' : currentValue)
|
onValueChange(currentValue === value ? '' : currentValue)
|
||||||
onOpenChange(false)
|
onOpenChange(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user