mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-26 18:33:30 +08:00
### What problem does this PR solve? Fix #14801 to allow search dataset list when add, following on #14825 <img width="2172" height="857" alt="image" src="https://github.com/user-attachments/assets/65ea7647-56f4-4c16-8437-121b834811f0" /> ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -188,6 +188,10 @@ interface MultiSelectProps
|
||||
showSelectAll?: boolean;
|
||||
popoverTestId?: string;
|
||||
optionTestIdPrefix?: string;
|
||||
searchValue?: string;
|
||||
onSearchChange?: (value: string) => void;
|
||||
isSearching?: boolean;
|
||||
shouldFilter?: boolean;
|
||||
}
|
||||
|
||||
export const MultiSelect = React.forwardRef<
|
||||
@@ -209,6 +213,10 @@ export const MultiSelect = React.forwardRef<
|
||||
showSelectAll = true,
|
||||
popoverTestId,
|
||||
optionTestIdPrefix,
|
||||
searchValue,
|
||||
onSearchChange,
|
||||
isSearching = false,
|
||||
shouldFilter,
|
||||
...props
|
||||
},
|
||||
ref,
|
||||
@@ -434,15 +442,19 @@ export const MultiSelect = React.forwardRef<
|
||||
onEscapeKeyDown={() => setIsPopoverOpen(false)}
|
||||
data-testid={popoverTestId}
|
||||
>
|
||||
<Command className="p-5 pb-8">
|
||||
{options && options.length > 0 && (
|
||||
<Command className="p-5 pb-8" shouldFilter={shouldFilter}>
|
||||
{((options && options.length > 0) || onSearchChange) && (
|
||||
<CommandInput
|
||||
placeholder={t('common.search') + '...'}
|
||||
onKeyDown={handleInputKeyDown}
|
||||
value={searchValue}
|
||||
onValueChange={onSearchChange}
|
||||
/>
|
||||
)}
|
||||
<CommandList className="mt-2">
|
||||
<CommandEmpty>No results found.</CommandEmpty>
|
||||
<CommandEmpty>
|
||||
{isSearching ? t('common.searching') : t('common.noDataFound')}
|
||||
</CommandEmpty>
|
||||
<CommandGroup>
|
||||
{showSelectAll && options && options.length > 0 && (
|
||||
<CommandItem
|
||||
|
||||
Reference in New Issue
Block a user