jeremybarbet / react-native-portalize

The simplest way to render anything on top of the rest.
MIT License
335 stars 22 forks source link

How to handle on Refresh on the modal if it has a flatlist #27

Open LouisMuriuki opened 1 year ago

LouisMuriuki commented 1 year ago

@jeremybarbet How do i handle the on refresh of a flat-list using modalize? currently when i try to swipe down on the flatlist the modal goes down as if to close.Is this the default behaviour Here is my implementation

<Portal>
      <Modalize
        modalHeight={600}
        ref={innerRef}
        HeaderComponent={
          <>
            <Text style={styles.title}>Confirm Mpesa Payments</Text>
            <Text style={styles.subtitle}>Latest Payments</Text>
          </>
        }
        flatListProps={{
          horizontal: false,
          keyExtractor: keyExtractor,
          data: payments,
          renderItem: renderItem,
          onEndReachedThreshold: 0.9,
          initialNumToRender: 10,
          onEndReached: LoadMoreProducts,
          refreshing: refresh,
          onRefresh: Refresh,
          contentContainerStyle: {
            flexGrow: 1,
            paddingBottom: 100,
          },
          ListFooterComponent: loading && (
            <View style={(alignItems = "center")}>
              <ActivityIndicator size="large" color="#f2f2f2" />
            </View>
          ),
          showsVerticalScrollIndicator: false,
        }}
      />
    </Portal>