Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Scroll Flatlist when touch started from Pager #63

@sanduluca

Description

@sanduluca

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}
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions