File tree Expand file tree Collapse file tree
packages/virtual-core/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- " @tanstack/virtual-core " : patch
2+ ' @tanstack/virtual-core ' : patch
33---
44
55fix(virtual-core): use getMaxScrollOffset() - paddingEnd for scrollToIndex(last) end-align, preserving lane-max behavior from #1001
Original file line number Diff line number Diff line change @@ -4308,7 +4308,11 @@ test('#1257: scrollToIndex(last) with paddingEnd keeps the last item flush with
43084308 virtualizer . scrollToIndex ( 4 , { align : 'end' } )
43094309
43104310 // getMaxScrollOffset() = 330 - 200 = 130; minus paddingEnd(80) = 50
4311- expect ( scrollToFn ) . toHaveBeenCalledWith ( 50 , expect . any ( Object ) , expect . any ( Object ) )
4311+ expect ( scrollToFn ) . toHaveBeenCalledWith (
4312+ 50 ,
4313+ expect . any ( Object ) ,
4314+ expect . any ( Object ) ,
4315+ )
43124316} )
43134317
43144318// ─── #1263: getMaxScrollOffset() preserves lane-max for multi-lane layouts ─────────────
@@ -4358,7 +4362,11 @@ test('#1263: scrollToIndex(last) in a shorter lane uses getMaxScrollOffset() lan
43584362 virtualizer . scrollToIndex ( 4 , { align : 'end' } )
43594363
43604364 // getMaxScrollOffset() = 200; minus paddingEnd(0) = 200
4361- expect ( scrollToFn ) . toHaveBeenCalledWith ( 200 , expect . any ( Object ) , expect . any ( Object ) )
4365+ expect ( scrollToFn ) . toHaveBeenCalledWith (
4366+ 200 ,
4367+ expect . any ( Object ) ,
4368+ expect . any ( Object ) ,
4369+ )
43624370} )
43634371
43644372// ─── #1257: paddingEnd=0 is a no-op ─────────────
@@ -4399,5 +4407,9 @@ test('#1257: scrollToIndex(last) with paddingEnd=0 uses getMaxScrollOffset() unc
43994407 virtualizer . scrollToIndex ( 4 , { align : 'end' } )
44004408
44014409 // getMaxScrollOffset() = 250 - 200 = 50; minus paddingEnd(0) = 50
4402- expect ( scrollToFn ) . toHaveBeenCalledWith ( 50 , expect . any ( Object ) , expect . any ( Object ) )
4410+ expect ( scrollToFn ) . toHaveBeenCalledWith (
4411+ 50 ,
4412+ expect . any ( Object ) ,
4413+ expect . any ( Object ) ,
4414+ )
44034415} )
You can’t perform that action at this time.
0 commit comments