|
8 | 8 | * - https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html |
9 | 9 | */ |
10 | 10 |
|
11 | | -import * as React from 'react'; |
12 | | -import { useRef } from 'react'; |
13 | 11 | import KeyCode from 'rc-util/lib/KeyCode'; |
14 | 12 | import type { ScrollTo } from 'rc-virtual-list/lib/List'; |
15 | | -import MultipleSelector from './MultipleSelector'; |
16 | | -import SingleSelector from './SingleSelector'; |
17 | | -import useLock from '../hooks/useLock'; |
| 13 | +import * as React from 'react'; |
| 14 | +import { useRef } from 'react'; |
18 | 15 | import type { CustomTagProps, DisplayValueType, Mode, RenderNode } from '../BaseSelect'; |
| 16 | +import useLock from '../hooks/useLock'; |
19 | 17 | import { isValidateOpenKey } from '../utils/keyUtil'; |
| 18 | +import MultipleSelector from './MultipleSelector'; |
| 19 | +import SingleSelector from './SingleSelector'; |
20 | 20 |
|
21 | 21 | export interface InnerSelectorProps { |
22 | 22 | prefixCls: string; |
@@ -47,7 +47,7 @@ export interface InnerSelectorProps { |
47 | 47 | } |
48 | 48 |
|
49 | 49 | export interface RefSelectorProps { |
50 | | - focus: () => void; |
| 50 | + focus: (options?: FocusOptions) => void; |
51 | 51 | blur: () => void; |
52 | 52 | scrollTo?: ScrollTo; |
53 | 53 | } |
@@ -122,8 +122,8 @@ const Selector: React.ForwardRefRenderFunction<RefSelectorProps, SelectorProps> |
122 | 122 |
|
123 | 123 | // ======================= Ref ======================= |
124 | 124 | React.useImperativeHandle(ref, () => ({ |
125 | | - focus: () => { |
126 | | - inputRef.current.focus(); |
| 125 | + focus: (options) => { |
| 126 | + inputRef.current.focus(options); |
127 | 127 | }, |
128 | 128 | blur: () => { |
129 | 129 | inputRef.current.blur(); |
|
0 commit comments