From da066fb4f4e846568869f4116c1ed2bde1258a70 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 10 Sep 2023 11:30:59 +0300 Subject: [PATCH] Fix seasons page not scrolled to top on initial load --- app/routes/u.$identifier/seasons.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/routes/u.$identifier/seasons.tsx b/app/routes/u.$identifier/seasons.tsx index 14aa96510..22fc926fb 100644 --- a/app/routes/u.$identifier/seasons.tsx +++ b/app/routes/u.$identifier/seasons.tsx @@ -1,8 +1,12 @@ import type { LoaderArgs, SerializeFrom } from "@remix-run/node"; import { Link, + useActionData, + useFetcher, + useFormAction, useLoaderData, useMatches, + useNavigation, useSearchParams, } from "@remix-run/react"; import clsx from "clsx"; @@ -572,6 +576,7 @@ function Matches() { }; React.useEffect(() => { + if (data.matches.currentPage === 1) return; ref.current?.scrollIntoView({ block: "center", });