From 65b7d0ba7425cb569a3662601eff372b1be466b4 Mon Sep 17 00:00:00 2001 From: Charles Kornoelje <33156025+charkour@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:22:35 -0400 Subject: [PATCH] (Fix) calling useWindowVirtulizer reset's page scroll to 0 If a user scrolls the page before `useWindowVirtualizer` is called, the scroll position will be reset to 0. This fixes that issue. --- packages/virtual-core/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/virtual-core/src/index.ts b/packages/virtual-core/src/index.ts index 77fbf49c2..9c8182768 100644 --- a/packages/virtual-core/src/index.ts +++ b/packages/virtual-core/src/index.ts @@ -187,7 +187,7 @@ export const measureElement = ( export const windowScroll = ( offset: number, { - adjustments = 0, + adjustments = window.scrollY, behavior, }: { adjustments?: number; behavior?: ScrollBehavior }, instance: Virtualizer,