Fix scroll jump on Back (#2067)
parent
9dec9d7276
commit
bb22ebd588
|
@ -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],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue