From b641efc87385b9c21ae34d14495e965261d25d69 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Wed, 20 Mar 2024 22:33:01 -0500 Subject: [PATCH] pull in scroll restore fix suggested by @julamb --- app/hooks/use-scroll-restoration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/hooks/use-scroll-restoration.ts b/app/hooks/use-scroll-restoration.ts index 32819302d7..8dbd8a5848 100644 --- a/app/hooks/use-scroll-restoration.ts +++ b/app/hooks/use-scroll-restoration.ts @@ -10,7 +10,7 @@ import { useLocation, useNavigation } from 'react-router-dom' function getScrollPosition(key: string) { const pos = window.sessionStorage.getItem(key) - return pos && /^[0-9]+$/.test(pos) ? parseInt(pos, 10) : 0 + return Number(pos) || 0 } function setScrollPosition(key: string, pos: number) {