Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

SubHeader will move up after pulling down. #186

Open
cj768025549 opened this issue Jul 10, 2021 · 1 comment
Open

SubHeader will move up after pulling down. #186

cj768025549 opened this issue Jul 10, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@cj768025549
Copy link

cj768025549 commented Jul 10, 2021

Information

  • react-native version: 0.64.5

  • react-navigation version:
    "@react-navigation/compat": "5.3.15",
    "@react-navigation/native": "5.9.4",
    "@react-navigation/stack": "5.14.4",

  • react-navigation-collapsible version: 5.10.2

  • Platform (iOS/Android): iOS

  • react-native init or Expo:

These are my codes:
const { onScroll, containerPaddingTop, translateY } = useCollapsibleSubHeader();

<Fragment> <Animated.FlatList renderItem={renderItem} keyExtractor={keyExtractor} onScroll={onScroll} data={data} ListEmptyComponent={ListEmptyComponent} ListHeaderComponent={ListHeaderComponent} refreshing={refreshing} onRefresh={onRefresh} viewabilityConfig={{ itemVisiblePercentThreshold: dimensionSize.padding60, }} onScrollEndDrag={onScrollEndDrag} onMomentumScrollEnd={onMomentumScrollEnd} progressViewOffset={containerPaddingTop} contentContainerStyle={[ { paddingTop: Platform.OS === PLATFORM.IOS ? 0 : containerPaddingTop, }, containerStyle, ]} contentInset={{ top: containerPaddingTop }} contentOffset={{ x: 0, y: -containerPaddingTop }} /> <CollapsibleSubHeaderAnimator translateY={translateY}>{header}</CollapsibleSubHeaderAnimator> </Fragment>

Because I want to show loading, show I add "contentInset" and "contentOffset". When I pull down a long distance and release it, the header will move up.

截屏2021-07-10 上午11 46 33

RPReplay_Final1625888410.MP4
@cj768025549 cj768025549 added the bug Something isn't working label Jul 10, 2021
@benevbright
Copy link
Owner

IMO, it looks difficult to fix.

Just for an idea, could you try to make your scrollview content not be unmounted during the refresh? (considering this blinking effect is also bad) and see if it helps? (I doubt, though)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants