@@ -3,16 +3,17 @@ import KeyCode from 'rc-util/lib/KeyCode';
3
3
import pickAttrs from 'rc-util/lib/pickAttrs' ;
4
4
import useMemo from 'rc-util/lib/hooks/useMemo' ;
5
5
import classNames from 'classnames' ;
6
- import List , { ListRef } from 'rc-virtual-list' ;
6
+ import type { ListRef } from 'rc-virtual-list' ;
7
+ import List from 'rc-virtual-list' ;
7
8
import TransBtn from './TransBtn' ;
8
- import {
9
+ import type {
9
10
OptionsType as SelectOptionsType ,
10
11
FlattenOptionData as SelectFlattenOptionData ,
11
12
OptionData ,
12
13
RenderNode ,
13
14
OnActiveValue ,
14
15
} from './interface' ;
15
- import { RawValueType , FlattenOptionsType } from './interface/generator' ;
16
+ import type { RawValueType , FlattenOptionsType } from './interface/generator' ;
16
17
17
18
export interface OptionListProps < OptionsType extends object [ ] > {
18
19
prefixCls : string ;
@@ -89,7 +90,7 @@ const OptionList: React.RefForwardingComponent<
89
90
// =========================== List ===========================
90
91
const listRef = React . useRef < ListRef > ( null ) ;
91
92
92
- const onListMouseDown : React . MouseEventHandler < HTMLDivElement > = event => {
93
+ const onListMouseDown : React . MouseEventHandler < HTMLDivElement > = ( event ) => {
93
94
event . preventDefault ( ) ;
94
95
} ;
95
96
@@ -176,7 +177,7 @@ const OptionList: React.RefForwardingComponent<
176
177
177
178
// ========================= Keyboard =========================
178
179
React . useImperativeHandle ( ref , ( ) => ( {
179
- onKeyDown : event => {
180
+ onKeyDown : ( event ) => {
180
181
const { which } = event ;
181
182
switch ( which ) {
182
183
// >>> Arrow keys
@@ -226,7 +227,7 @@ const OptionList: React.RefForwardingComponent<
226
227
} ,
227
228
onKeyUp : ( ) => { } ,
228
229
229
- scrollTo : index => {
230
+ scrollTo : ( index ) => {
230
231
scrollIntoView ( index ) ;
231
232
} ,
232
233
} ) ) ;
0 commit comments