diff --git a/src/view/com/util/List.web.tsx b/src/view/com/util/List.web.tsx index 777f56b9d6..478556b6e8 100644 --- a/src/view/com/util/List.web.tsx +++ b/src/view/com/util/List.web.tsx @@ -1,11 +1,5 @@ import React, {memo, startTransition} from 'react' -import { - FlatListProps, - RefreshControl, - ScrollView, - StyleSheet, - View, -} from 'react-native' +import {FlatListProps, StyleSheet, View} from 'react-native' import {addStyle} from 'lib/styles' import {usePalette} from 'lib/hooks/usePalette' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' @@ -113,18 +107,15 @@ function ListImpl( return } function handleScroll() { - // TODO + console.log(window.scrollY) } window.addEventListener('scroll', handleScroll) return () => window.removeEventListener('scroll', handleScroll) }, [isVisible]) return ( - { - setIsVisible(newIsVisible) - }}> - + + ( desktopFixedHeight ? styles.minHeightViewport : null, pal.border, ]}> + + { + setIsVisible(newIsVisible) + }} + /> + {header} {(data as Array).map((item, index) => ( @@ -156,8 +154,8 @@ function ListImpl( )} {footer} - - + + ) } @@ -189,11 +187,9 @@ Row = React.memo(Row) let Visibility = ({ threshold = 0, onVisibleChange, - children, }: { threshold?: number | null | undefined onVisibleChange: (isVisible: boolean) => void - children?: React.ReactNode }): React.ReactNode => { const tailRef = React.useRef(null) const isIntersecting = React.useRef(false) @@ -220,7 +216,7 @@ let Visibility = ({ } }, [handleIntersection, threshold]) - return {children} + return } Visibility = React.memo(Visibility) @@ -240,11 +236,15 @@ const styles = StyleSheet.create({ marginRight: 'auto', }, row: { - // @ts-ignore web + // @ts-ignore web only contentVisibility: 'auto', }, minHeightViewport: { // @ts-ignore web only minHeight: '100vh', }, + visibilityDetector: { + // @ts-ignore web only + position: 'fixed', + }, })