Call updateActiveVideoViewAsync on List layout changes

https://claude.ai/code/session_013p1d2oZjFMg549WZe6JjLw
This commit is contained in:
Claude
2026-03-24 12:29:17 +00:00
committed by Samuel Newman
parent cc5580848c
commit 397520cf5b
+8 -1
View File
@@ -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<ListMethods, ListProps>(
headerOffset,
style,
progressViewOffset,
onLayout,
automaticallyAdjustsScrollIndicatorInsets = false,
...props
},
@@ -153,6 +154,11 @@ let List = forwardRef<ListMethods, ListProps>(
contentOffset = {x: 0, y: headerOffset * -1}
}
const handleLayout = (e: LayoutChangeEvent) => {
updateActiveVideoViewAsync()
onLayout?.(e)
}
return (
<FlatList_INTERNAL
showsVerticalScrollIndicator // overridable
@@ -170,6 +176,7 @@ let List = forwardRef<ListMethods, ListProps>(
indicatorStyle={t.scheme === 'dark' ? 'white' : 'black'}
contentOffset={contentOffset}
refreshControl={refreshControl}
onLayout={handleLayout}
onScroll={scrollHandler}
scrollsToTop={scrollsToTop}
scrollEventThrottle={1}