|
1 |
| -import type { BaseSelectProps, BaseSelectPropsWithoutPrivate, BaseSelectRef } from 'rc-select'; |
| 1 | +import type { BaseSelectPropsWithoutPrivate, BaseSelectRef } from 'rc-select'; |
2 | 2 | import { BaseSelect } from 'rc-select';
|
3 | 3 | import useId from 'rc-select/lib/hooks/useId';
|
4 | 4 | import type { IconType } from 'rc-tree/lib/interface';
|
@@ -212,7 +212,7 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
|
212 | 212 | postState: search => search || '',
|
213 | 213 | });
|
214 | 214 |
|
215 |
| - const onInternalSearch: BaseSelectProps['onSearch'] = searchText => { |
| 215 | + const onInternalSearch = searchText => { |
216 | 216 | setSearchValue(searchText);
|
217 | 217 | onSearch?.(searchText);
|
218 | 218 | };
|
@@ -581,21 +581,19 @@ const TreeSelect = React.forwardRef<BaseSelectRef, TreeSelectProps>((props, ref)
|
581 | 581 | );
|
582 | 582 |
|
583 | 583 | // ====================== Display Change ========================
|
584 |
| - const onDisplayValuesChange = useRefFunc<BaseSelectProps['onDisplayValuesChange']>( |
585 |
| - (newValues, info) => { |
586 |
| - const newRawValues = newValues.map(item => item.value); |
| 584 | + const onDisplayValuesChange = useRefFunc((newValues, info) => { |
| 585 | + const newRawValues = newValues.map(item => item.value); |
587 | 586 |
|
588 |
| - if (info.type === 'clear') { |
589 |
| - triggerChange(newRawValues, {}, 'selection'); |
590 |
| - return; |
591 |
| - } |
| 587 | + if (info.type === 'clear') { |
| 588 | + triggerChange(newRawValues, {}, 'selection'); |
| 589 | + return; |
| 590 | + } |
592 | 591 |
|
593 |
| - // TreeSelect only have multiple mode which means display change only has remove |
594 |
| - if (info.values.length) { |
595 |
| - onOptionSelect(info.values[0].value, { selected: false, source: 'selection' }); |
596 |
| - } |
597 |
| - }, |
598 |
| - ); |
| 592 | + // TreeSelect only have multiple mode which means display change only has remove |
| 593 | + if (info.values.length) { |
| 594 | + onOptionSelect(info.values[0].value, { selected: false, source: 'selection' }); |
| 595 | + } |
| 596 | + }); |
599 | 597 |
|
600 | 598 | // ========================== Context ===========================
|
601 | 599 | const treeSelectContext = React.useMemo<TreeSelectContextProps>(
|
|
0 commit comments