File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -309,10 +309,15 @@ const Reader = ({
309309 onViewportsMeasured && onViewportsMeasured ( ) ;
310310
311311 if ( scrollAnchor ) {
312- const startOffset = virtualizer . getOffsetForIndex (
313- scrollAnchor . index ,
314- "start" ,
315- ) ?. [ 0 ] ;
312+ // const startOffset = virtualizer.getOffsetForIndex(
313+ // scrollAnchor.index,
314+ // "start",
315+ // )?.[0];
316+ let offset = virtualizer . options . paddingStart ;
317+ for ( let i = 0 ; i < scrollAnchor . index ; i ++ ) {
318+ offset += estimateSize ( i ) + virtualizer . options . gap ;
319+ }
320+ const startOffset = offset ;
316321
317322 console . log ( { ...scrollAnchor } ) ;
318323 if ( startOffset != null ) {
@@ -324,7 +329,8 @@ const Reader = ({
324329 } ) ;
325330 const offsetExtra = itemHeight * scrollAnchor . percentageOffsetY * 0.01 ;
326331 console . log ( {
327- startOffset,
332+ wantPageIndex : scrollAnchor . index ,
333+ startOffsetForPage : startOffset ,
328334 itemHeight,
329335 percentage : scrollAnchor . percentageOffsetY ,
330336 offsetExtra,
You can’t perform that action at this time.
0 commit comments