sophister / react-native-pull-to-refresh-custom

Custom pull to refresh Header supporting for React Native ScrollView/FlatList
97 stars 23 forks source link

can not pull down when FlatList/ScrollView is scrollable #1

Open pasicopan opened 5 years ago

pasicopan commented 5 years ago

question

<PullToRefresh
    style={{ flex: 1, backgroundColor: 'red' }}
>
    <FlatList
        style={{ flex: 1 }}
        scrollEventThrottle={20}
    />
</PullToRefresh>
// or
<PullToRefresh
    style={{ flex: 1, backgroundColor: 'red' }}
>
    <ScrollView
        style={{ flex: 1 }}
        scrollEventThrottle={20}
    />
</PullToRefresh>

react:

os:

simulator:

sophister commented 5 years ago

@pasicopan can you provide a Expo demo, so I can take a look? thx

liubingbing commented 5 years ago

安卓上面,使用FlatList/ScrollView 时候。下拉刷新不灵敏,必须长按页面才能下拉刷新。滑动的时候触发不了下拉刷新View,Expo demo 版本2.12.2

sophister commented 5 years ago

@liubingbing 嗯,如果是从滚动区域下面开始往顶部滚动,在滚动到顶部的时候,不能 触发下拉动作,因为这时候外面的 View 没有捕获到手势,被内部的滚动组件捕获了。

另外那个下拉不灵敏,必须要长按才能触发,我好像没有遇到。如果内部的滚动组件没有处于最顶部的位置,那就不能触发外部的滚动手势

liubingbing commented 5 years ago

如果是从滚动区域下面开始往顶部滚动,在滚动到顶部的时候,不能 触发下拉动作,因为这时候外面的 View 没有捕获到手势,被内部的滚动组件捕获了。这种情况安卓,有办法解决?

sophister commented 5 years ago

@liubingbing 我这个实现,没有找到解决办法 😂

sophister commented 4 years ago

latest version 1.0.3 should fix the scroll problem

mtford90 commented 4 years ago

Just tried this on 1.0.3 and the issue still exists. If I scroll down the flatlist, and then scroll back up, can no longer pull to refresh.

However if I pull to refresh straight away, without scrolling, it works fine.

sophister commented 4 years ago

@mtford90 when you scroll down the flatlist, then scroll back up to top, you cannot trigger the pull to refresh without releasing your touch. You can only trigger pull to refresh with another touch action.