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 6060 "rc-animate" : " ^2.9.1" ,
6161 "react" : " ^v16.9.0-alpha.0" ,
6262 "react-dom" : " ^v16.9.0-alpha.0" ,
63- "typescript" : " ^3.5.2 "
63+ "typescript" : " ^4.0.0 "
6464 },
6565 "dependencies" : {
6666 "@babel/runtime" : " ^7.20.0" ,
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export default function useScrollTo<T>(
1717) : ScrollTo {
1818 const scrollRef = React . useRef < number > ( ) ;
1919
20- return arg => {
20+ return ( arg ) => {
2121 // When not argument provided, we think dev may want to show the scrollbar
2222 if ( arg === null || arg === undefined ) {
2323 triggerFlash ( ) ;
@@ -36,7 +36,7 @@ export default function useScrollTo<T>(
3636 if ( 'index' in arg ) {
3737 ( { index } = arg ) ;
3838 } else {
39- index = data . findIndex ( item => getKey ( item ) === arg . key ) ;
39+ index = data . findIndex ( ( item ) => getKey ( item ) === arg . key ) ;
4040 }
4141
4242 const { offset = 0 } = arg ;
@@ -106,7 +106,7 @@ export default function useScrollTo<T>(
106106 collectHeight ( ) ;
107107 }
108108 syncScroll ( times - 1 , newTargetAlign ) ;
109- } ) ;
109+ } , 2 ) ; // Delay 2 to wait for List collect heights
110110 } ;
111111
112112 syncScroll ( 3 ) ;
You can’t perform that action at this time.
0 commit comments