File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
file-tree-next/src/browser/dialog Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ export interface ISelectProps<T = string> {
2727 disabled ?: boolean ;
2828 onChange ?: ( value : T ) => void ;
2929 onSearchChange ?: ( value : string ) => void ;
30+ /**
31+ * 搜索行为不采用默认的 filterOptions 进行筛选,由外部托管
32+ */
33+ externalSearchBehavior ?: boolean ;
3034 /**
3135 * 当鼠标划过时触发回调
3236 * @param value 鼠标划过的是第几个 option
@@ -290,6 +294,7 @@ export function Select<T = string>({
290294 description,
291295 notMatchWarning,
292296 onSearchChange,
297+ externalSearchBehavior
293298} : ISelectProps < T > ) {
294299 const [ open , setOpen ] = useState < boolean > ( false ) ;
295300 const [ searchInput , setSearchInput ] = useState ( '' ) ;
@@ -526,7 +531,7 @@ export function Select<T = string>({
526531 { showWarning && < div className = 'kt-select-warning-text' > { notMatchWarning } </ div > }
527532
528533 { open &&
529- ! searchInput &&
534+ ! ( externalSearchBehavior && searchInput ) &&
530535 ( isDataOptions ( filteredOptions ) || isDataOptionGroups ( filteredOptions ) ? (
531536 < SelectOptionsList
532537 optionRenderer = { optionRenderer }
Original file line number Diff line number Diff line change @@ -288,6 +288,7 @@ export const FileDialog = ({
288288 searchPlaceholder = { selectPath }
289289 value = { selectPath }
290290 showSearch = { showFilePathSearch }
291+ externalSearchBehavior = { true }
291292 >
292293 { directoryList . map ( ( item , idx ) => (
293294 < Option value = { item } key = { `${ idx } - ${ item } ` } >
You can’t perform that action at this time.
0 commit comments