Fix automatic footer compensation in Layout.Content (#10526)

This commit is contained in:
Samuel Newman
2026-05-18 12:57:06 +01:00
committed by GitHub
parent 45597de6e0
commit e58a09e0ca
+9 -10
View File
@@ -7,7 +7,7 @@ import {
} from 'react-native'
import Animated, {
type AnimatedScrollViewProps,
useAnimatedProps,
useAnimatedStyle,
} from 'react-native-reanimated'
import {useSafeAreaInsets} from 'react-native-safe-area-context'
@@ -88,14 +88,14 @@ export const Content = memo(
const t = useTheme()
const {footerHeight} = useShellLayout()
const {isWithinSplitView} = useIsWithinSplitView()
const animatedProps = useAnimatedProps(() => {
// note - if we ever make the footer transparent in any way,
// we'll need to change this to use contentInsets/scrollIndicatorInsets
// on iOS and contentContainerStyle padding on Android -sfn
const animatedStyle = useAnimatedStyle(() => {
return {
scrollIndicatorInsets: {
bottom: footerHeight.get(),
top: 0,
right: 1,
},
} satisfies AnimatedScrollViewProps
marginBottom: footerHeight.get(),
}
})
return (
@@ -104,10 +104,9 @@ export const Content = memo(
id="content"
automaticallyAdjustsScrollIndicatorInsets={false}
indicatorStyle={t.scheme === 'dark' ? 'white' : 'black'}
// sets the scroll inset to the height of the footer
animatedProps={animatedProps}
style={[
a.w_full,
animatedStyle,
isWithinSplitView &&
web({
flex: 1,