Fix scroll jump on Back (#2067)
This commit is contained in:
@@ -69,13 +69,19 @@ export const PagerWithHeader = React.forwardRef<PagerRef, PagerWithHeaderProps>(
|
|||||||
// capture the header bar sizing
|
// capture the header bar sizing
|
||||||
const onTabBarLayout = React.useCallback(
|
const onTabBarLayout = React.useCallback(
|
||||||
(evt: LayoutChangeEvent) => {
|
(evt: LayoutChangeEvent) => {
|
||||||
setTabBarHeight(evt.nativeEvent.layout.height)
|
const height = evt.nativeEvent.layout.height
|
||||||
|
if (height > 0) {
|
||||||
|
setTabBarHeight(height)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[setTabBarHeight],
|
[setTabBarHeight],
|
||||||
)
|
)
|
||||||
const onHeaderOnlyLayout = React.useCallback(
|
const onHeaderOnlyLayout = React.useCallback(
|
||||||
(evt: LayoutChangeEvent) => {
|
(evt: LayoutChangeEvent) => {
|
||||||
setHeaderOnlyHeight(evt.nativeEvent.layout.height)
|
const height = evt.nativeEvent.layout.height
|
||||||
|
if (height > 0) {
|
||||||
|
setHeaderOnlyHeight(height)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[setHeaderOnlyHeight],
|
[setHeaderOnlyHeight],
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user