netguru / sticky-parallax-header

A simple React Native library, enabling the creation of fully customized header for your iOS and Android apps.
https://netguru.github.io/sticky-parallax-header/
MIT License
1.86k stars 190 forks source link

StickyHeaderFlatList Not Show Fully Refresh Control When Has Header #408

Open hoangtam101 opened 1 year ago

hoangtam101 commented 1 year ago

Environment

Library version: 1.1.1 OS version: iPhone 11, iOS 16.6

Affected platforms

Current behavior

When I pull down to make pull refresh visible, then I release the touch. The animation of the pull to refresh control behind the Header.

Expected behavior

The pull to refresh control should be visible and bottom of the header

Reproduction

const [isRefresh, setRefresh] = useState(false);

const handleRefresh = useCallback(async () => { setRefresh(true); }, []);

<StickyHeaderFlatList numColumns={3} ref={flatListRef} data={data} renderHeader={() =>

} refreshing={isRefresh} onRefresh={handleRefresh} renderTabs={() => ( <SegmentType segmentType={segmentType} onSegmentPress={onSegmentPress} /> )} renderItem={({ item }) => (

        )}
        keyExtractor={(item: { name: string }) => item.name}
        onEndReached={loadMoreData}
        scrollEventThrottle={16}
      />
hoangtam101 commented 1 year ago

Hi, any update on this issue? Thanks,

Paul12pp commented 1 year ago

x2 Hi, any update on this issue? Thanks,

maximesenger commented 4 months ago

Same issue here. It is because the refresh indicator is under the renderTabs. The way is fixed it is by doing this :

<RefreshControl
            style={{ zIndex: 1 }}
            title="Refreshing..."
            colors={[color.brandPrimary]}
            progressViewOffset={175}
            refreshing={isLoading}
            onRefresh={refreshPublicStores}
/>

Set your progressViewOffset depending on the height of your tabs