diff --git a/src/view/com/util/List.tsx b/src/view/com/util/List.tsx index c8c4007f02..8c7b20c98a 100644 --- a/src/view/com/util/List.tsx +++ b/src/view/com/util/List.tsx @@ -1,5 +1,5 @@ import {forwardRef, memo, useDeferredValue, useMemo} from 'react' -import {RefreshControl, type ViewToken} from 'react-native' +import {RefreshControl, type LayoutChangeEvent, type ViewToken} from 'react-native' import { type FlatListPropsWithLayout, runOnJS, @@ -54,6 +54,7 @@ let List = forwardRef( headerOffset, style, progressViewOffset, + onLayout, automaticallyAdjustsScrollIndicatorInsets = false, ...props }, @@ -153,6 +154,11 @@ let List = forwardRef( contentOffset = {x: 0, y: headerOffset * -1} } + const handleLayout = (e: LayoutChangeEvent) => { + updateActiveVideoViewAsync() + onLayout?.(e) + } + return ( ( indicatorStyle={t.scheme === 'dark' ? 'white' : 'black'} contentOffset={contentOffset} refreshControl={refreshControl} + onLayout={handleLayout} onScroll={scrollHandler} scrollsToTop={scrollsToTop} scrollEventThrottle={1}