Fix some issues with restoration
This commit is contained in:
+4
-1
@@ -521,7 +521,10 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
|
|||||||
// TODO: Clean up?
|
// TODO: Clean up?
|
||||||
navigationRef.current?.addListener('__unsafe_action__', e => {
|
navigationRef.current?.addListener('__unsafe_action__', e => {
|
||||||
if (webFocusedScreen) {
|
if (webFocusedScreen) {
|
||||||
webScrollPositions.set(webFocusedScreen, window.scrollY)
|
webScrollPositions.set(
|
||||||
|
webFocusedScreen,
|
||||||
|
Math.round(window.scrollY),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export const Pager = React.forwardRef(function PagerImpl(
|
|||||||
|
|
||||||
const onTabBarSelect = React.useCallback(
|
const onTabBarSelect = React.useCallback(
|
||||||
(index: number) => {
|
(index: number) => {
|
||||||
const scrollY = window.scrollY
|
const scrollY = Math.round(window.scrollY)
|
||||||
scrollYs.current[selectedPage] = scrollY
|
scrollYs.current[selectedPage] = scrollY
|
||||||
setSelectedPage(index)
|
setSelectedPage(index)
|
||||||
onPageSelected?.(index)
|
onPageSelected?.(index)
|
||||||
|
|||||||
Reference in New Issue
Block a user