Fix some issues with restoration

This commit is contained in:
Dan Abramov
2023-12-21 02:46:30 +00:00
parent 749b6845c5
commit e09b3185bb
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -521,7 +521,10 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
// TODO: Clean up?
navigationRef.current?.addListener('__unsafe_action__', e => {
if (webFocusedScreen) {
webScrollPositions.set(webFocusedScreen, window.scrollY)
webScrollPositions.set(
webFocusedScreen,
Math.round(window.scrollY),
)
}
})
}
+1 -1
View File
@@ -36,7 +36,7 @@ export const Pager = React.forwardRef(function PagerImpl(
const onTabBarSelect = React.useCallback(
(index: number) => {
const scrollY = window.scrollY
const scrollY = Math.round(window.scrollY)
scrollYs.current[selectedPage] = scrollY
setSelectedPage(index)
onPageSelected?.(index)