File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 60
60
"rc-animate" : " ^2.9.1" ,
61
61
"react" : " ^v16.9.0-alpha.0" ,
62
62
"react-dom" : " ^v16.9.0-alpha.0" ,
63
- "typescript" : " ^3.5.2 "
63
+ "typescript" : " ^4.0.0 "
64
64
},
65
65
"dependencies" : {
66
66
"@babel/runtime" : " ^7.20.0" ,
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export default function useScrollTo<T>(
17
17
) : ScrollTo {
18
18
const scrollRef = React . useRef < number > ( ) ;
19
19
20
- return arg => {
20
+ return ( arg ) => {
21
21
// When not argument provided, we think dev may want to show the scrollbar
22
22
if ( arg === null || arg === undefined ) {
23
23
triggerFlash ( ) ;
@@ -36,7 +36,7 @@ export default function useScrollTo<T>(
36
36
if ( 'index' in arg ) {
37
37
( { index } = arg ) ;
38
38
} else {
39
- index = data . findIndex ( item => getKey ( item ) === arg . key ) ;
39
+ index = data . findIndex ( ( item ) => getKey ( item ) === arg . key ) ;
40
40
}
41
41
42
42
const { offset = 0 } = arg ;
@@ -106,7 +106,7 @@ export default function useScrollTo<T>(
106
106
collectHeight ( ) ;
107
107
}
108
108
syncScroll ( times - 1 , newTargetAlign ) ;
109
- } ) ;
109
+ } , 2 ) ; // Delay 2 to wait for List collect heights
110
110
} ;
111
111
112
112
syncScroll ( 3 ) ;
You can’t perform that action at this time.
0 commit comments