Skip to content

Commit 431a122

Browse files
autofix-ci[bot]dikshit-n
authored andcommitted
ci: apply automated fixes
1 parent 5d30409 commit 431a122

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"@tanstack/virtual-core": patch
2+
'@tanstack/virtual-core': patch
33
---
44

55
fix(virtual-core): use getMaxScrollOffset() - paddingEnd for scrollToIndex(last) end-align, preserving lane-max behavior from #1001

packages/virtual-core/tests/index.test.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff 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
})

0 commit comments

Comments
 (0)