From 18f401804529f246d67c7e9174506de7f651e5b1 Mon Sep 17 00:00:00 2001 From: Charles Kornoelje <33156025+charkour@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:30:52 -0400 Subject: [PATCH] fix: calling useWindowVirtulizer reset's page scroll to 0 (#566) 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 f9238d98..d6bd202b 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,