fix(virtual-core): sync `scrollOffset` in `applyScrollAdjustment` so end-anchored resize is not lost to browser clamp (#1209)
With `anchorTo: 'end'` and a dynamically growing last item, `resizeItem` calls `applyScrollAdjustment` before `notify()`, so the `scrollTop` write lands while the sizer is still at the old `getTotalSize()`. The browser clamps the write, no scroll event fires, and `scrollOffset` stays stale. The next tick's `getVirtualDistanceFromEnd()` then exceeds `scrollEndThreshold`, `wasAtEnd` flips false, and the viewport drifts away from the end from the second resize onward. Carry the intended target in `scrollOffset` (and zero `scrollAdjustments` to keep their sum invariant) the same way the prepend path in `setOptions` does (#1176), so the next `wasAtEnd` check sees the post-adjustment position regardless of whether the DOM write was clamped.
M
Marius Schulz committed
37be28427ba52399ce8884e0006933e83f2645e9
Parent: b04f9ee
Committed by GitHub <noreply@github.com>
on 6/26/2026, 10:16:12 AM