ajsmth / react-native-pager

controllable pager component for react native
MIT License
334 stars 28 forks source link

Scroll Flatlist when touch started from Pager #63

Open sanduluca opened 3 years ago

sanduluca commented 3 years ago

A have a Flatlist and the Pager is inside ListHeaderComponent prop. So I want to achieve scrolling the Flatlist from Pager area. For example, I will touch the screen in the red square and will try to scroll up. image

<FlatList
  onScroll={onScroll}
  showsVerticalScrollIndicator={false}
  data={data}
  renderItem={...}
  ListHeaderComponent={() => (
    <Pager
      activeIndex={activeSlide}
      onChange={setActiveSlide}
      clamp={{ prev: 0 }}
      clampDrag={{ prev: activeSlide === 0 ? 0 : 1 }}
      style={{ flex: 1, overflow: 'hidden', width: windowWidth }}
    >
          {thumbnails.map(img => (
          <Image
              key={img}
              source={{ uri: img }}
              resizeMode="cover"
              style={styles.mainImage}
            />
          ))}
   </Pager>
  )}
  ListFooterComponent={this._renderFooterComponent}
/>
sanduluca commented 3 years ago

@ajsmth @tobiaslins @TheNoim Can you help with this please?