|
1 | | -import { useBaseProps } from 'rc-select'; |
2 | | -import type { RefOptionListProps } from 'rc-select/lib/OptionList'; |
| 1 | +import { useBaseProps } from '@rc-component/select'; |
| 2 | +import type { RefOptionListProps } from '@rc-component/select/lib/OptionList'; |
3 | 3 | import type { TreeProps } from 'rc-tree'; |
4 | 4 | import Tree from 'rc-tree'; |
5 | 5 | import { UnstableContext } from 'rc-tree'; |
6 | 6 | import type { EventDataNode, ScrollTo } from 'rc-tree/lib/interface'; |
7 | | -import KeyCode from 'rc-util/lib/KeyCode'; |
8 | | -import useMemo from 'rc-util/lib/hooks/useMemo'; |
| 7 | +import KeyCode from '@rc-component/util/lib/KeyCode'; |
| 8 | +import useMemo from '@rc-component/util/lib/hooks/useMemo'; |
9 | 9 | import * as React from 'react'; |
10 | 10 | import LegacyContext from './LegacyContext'; |
11 | 11 | import TreeSelectContext from './TreeSelectContext'; |
12 | 12 | import type { DataNode, Key, SafeKey } from './interface'; |
13 | 13 | import { getAllKeys, isCheckDisabled } from './utils/valueUtil'; |
14 | | -import { useEvent } from 'rc-util'; |
| 14 | +import { useEvent } from '@rc-component/util'; |
15 | 15 |
|
16 | 16 | const HIDDEN_STYLE = { |
17 | 17 | width: 0, |
@@ -43,7 +43,7 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_, |
43 | 43 | treeData, |
44 | 44 | fieldNames, |
45 | 45 | onSelect, |
46 | | - dropdownMatchSelectWidth, |
| 46 | + popupMatchSelectWidth, |
47 | 47 | treeExpandAction, |
48 | 48 | treeTitleRender, |
49 | 49 | onPopupScroll, |
@@ -263,6 +263,7 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_, |
263 | 263 | } |
264 | 264 |
|
265 | 265 | setActiveKey(nextActiveKey); |
| 266 | + // eslint-disable-next-line react-hooks/exhaustive-deps |
266 | 267 | }, [open, searchValue]); |
267 | 268 |
|
268 | 269 | // ========================= Keyboard ========================= |
@@ -305,6 +306,7 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_, |
305 | 306 |
|
306 | 307 | const hasLoadDataFn = useMemo( |
307 | 308 | () => (searchValue ? false : true), |
| 309 | + // eslint-disable-next-line react-hooks/exhaustive-deps |
308 | 310 | [searchValue, treeExpandedKeys || expandedKeys], |
309 | 311 | ([preSearchValue], [nextSearchValue, nextExcludeSearchExpandedKeys]) => |
310 | 312 | preSearchValue !== nextSearchValue && !!(nextSearchValue || nextExcludeSearchExpandedKeys), |
@@ -347,7 +349,7 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_, |
347 | 349 | height={listHeight} |
348 | 350 | itemHeight={listItemHeight} |
349 | 351 | itemScrollOffset={listItemScrollOffset} |
350 | | - virtual={virtual !== false && dropdownMatchSelectWidth !== false} |
| 352 | + virtual={virtual !== false && popupMatchSelectWidth !== false} |
351 | 353 | multiple={multiple} |
352 | 354 | icon={treeIcon} |
353 | 355 | showIcon={showTreeIcon} |
|
0 commit comments