React-native-draggable-flatlist: Pull to refresh is not working

Created on 3 Nov 2020  路  7Comments  路  Source: computerjazz/react-native-draggable-flatlist

Describe the bug
Pull to refresh is not working even though using refreshControl. Refresh control prevents draggable-flatlist from scrolling. using two-finger I can able to scroll but that not we need.

please add support for,
onRefresh = {this.PullToRefresh}
refreshing = {this.state.iRefreshing}

I have tried for closed issue #135 as well but it also not working.

Platform & Dependencies

  • Platform: Android
  • React Native version: 0.59.9
  • Reanimated version: 1.8.0
  • React Native Gesture Handler version:1.6.1

Thanks in advance.

Most helpful comment

Did you even try this code? :D you create a variable onRefresh but you never use it..

All 7 comments

Hello All,

Please use like below those who are not able to handle pull to refresh,

const App = () => {
const [refreshing, setRefreshing] = React.useState(false);
const [data,setData] = React.useState(exampleData)
const onRefresh = React.useCallback(() => {
setRefreshing(true);
wait(2000).then(() => setRefreshing(false));
}, []);

return (
contentContainerStyle={styles.scrollView}
refreshControl={}>
data={data}
renderItem={renderItem}
keyExtractor={(item, index) => draggable-item-${item.key}}
onDragEnd={({ data }) => setData(data)}
/>



);
}

const styles = StyleSheet.create({
container: {
flex: 1,
marginTop: 20,
},
scrollView: {
flex: 1,
width: "100%",
backgroundColor: 'gray',
alignItems: 'center',
justifyContent: 'center',
zIndex: 1
},
dragList: {
width: "90%",
height: '90%',
zIndex: 0,
position: 'absolute',
}
});

Did you even try this code? :D you create a variable onRefresh but you never use it..

Did you even try this code? :D you create a variable onRefresh but you never use it..

use inside scroll view refreshcontrol, but this is not working in android. i think there is a gesutre problem. using two finger pull it will invoking the refresh control method, but thats not a good way.

@dev-sathish Are you sure this code works?

I'm not sure @gdoudeng. Seems it works in ios.

I'm not sure @gdoudeng. Seems it works in ios.

No problem in iOS, but not working in Android

Same problem. Works on IOS but not on Android

Was this page helpful?
0 / 5 - 0 ratings