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 {forwardRef, memo, useDeferredValue, useMemo} from 'react'
import {RefreshControl, type ViewToken} from 'react-native' import {RefreshControl, type LayoutChangeEvent, type ViewToken} from 'react-native'
import { import {
type FlatListPropsWithLayout, type FlatListPropsWithLayout,
runOnJS, runOnJS,
@@ -54,6 +54,7 @@ let List = forwardRef<ListMethods, ListProps>(
headerOffset, headerOffset,
style, style,
progressViewOffset, progressViewOffset,
onLayout,
automaticallyAdjustsScrollIndicatorInsets = false, automaticallyAdjustsScrollIndicatorInsets = false,
...props ...props
}, },
@@ -153,6 +154,11 @@ let List = forwardRef<ListMethods, ListProps>(
contentOffset = {x: 0, y: headerOffset * -1} contentOffset = {x: 0, y: headerOffset * -1}
} }
const handleLayout = (e: LayoutChangeEvent) => {
updateActiveVideoViewAsync()
onLayout?.(e)
}
return ( return (
<FlatList_INTERNAL <FlatList_INTERNAL
showsVerticalScrollIndicator // overridable showsVerticalScrollIndicator // overridable
@@ -170,6 +176,7 @@ let List = forwardRef<ListMethods, ListProps>(
indicatorStyle={t.scheme === 'dark' ? 'white' : 'black'} indicatorStyle={t.scheme === 'dark' ? 'white' : 'black'}
contentOffset={contentOffset} contentOffset={contentOffset}
refreshControl={refreshControl} refreshControl={refreshControl}
onLayout={handleLayout}
onScroll={scrollHandler} onScroll={scrollHandler}
scrollsToTop={scrollsToTop} scrollsToTop={scrollsToTop}
scrollEventThrottle={1} scrollEventThrottle={1}