question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to drag the list

See original GitHub issue

I was using the old version (1.1.9). But couldn’t make my flatlist fully draggable. Here was some issue in that version 1. unable to drag if list is long 2) can’t move bottom to top. 3) sometime list item get stuck 4) scrolling stops after first time etc., So after looking for some solution with no result, i decided to upgrade the version of your library. But it is worsen the situation. Now the list is not moving at all. here is my dependencies:

"dependencies": {
   "@react-native-community/async-storage": "^1.7.1",
   "@react-native-community/datetimepicker": "^2.1.0",
   "@react-native-community/netinfo": "^5.5.0",
   "@sendgrid/mail": "^6.4.0",
   "native-base": "^2.13.8",
   "react": "16.9.0",
   "react-native": "0.61.2",
   "react-native-draggable-flatlist": "^2.3.1",
   "react-native-gesture-handler": "^1.6.0",
   "react-native-linear-gradient": "^2.5.6",
   "react-native-loading-spinner-overlay": "^1.0.1",
   "react-native-material-dropdown": "^0.11.1",
   "react-native-material-menu": "^1.0.0",
   "react-native-reanimated": "^1.7.0",
   "react-native-searchbar": "^1.16.0",
   "react-native-vector-icons": "^6.6.0",
   "react-navigation": "^4.0.10",
   "react-navigation-stack": "^1.9.4",
   "realm": "^4.0.0-beta.0",
   "uuid": "^3.4.0"
 },

Here is my component structure:

<Root>
        <ImageBackground>
        .......
                <View>
                       <DraggableFlatList
					style={styles.listStyle}
					data={this.state.customers}
					renderItem={this.renderItem}
					keyExtractor={item => item.borrower_id.toString()}
					onMoveEnd={({ data }) => this.sortCustomerDetails(data)} />
                </View>
        ........
        </ImageBackground>
</Root>
...................
...................

renderItem = ({ item, index, move, moveEnd, isActive }) => {
		return (
			<TouchableHighlight
				onLongPress={move}
				onPressOut={moveEnd}
				underlayColor="transparent"
				onPress={ () => this.viewCustomerDetails(item)}>

				<Customer customerDetails={item} />

			</TouchableHighlight>
		)
}

Customer.js

render() {
		return (
			<LinearGradient
				start={{x: 0, y: 0}}
				end={{x: 1, y: 0}}
				colors={['#4b2e80', '#583696', '#633da9', '#997cd0']}
				style={styles.customerDetailsWrapper}>

				<View style={ styles.customerDetails }>
					<Text style={styles.borrower_name}>{this.props.customerDetails.name}</Text>
				</View>
			</LinearGradient>
		);
	}

Note: i only installed react-native-reanimated and react-native-linear-gradient but did not run react-native link as React-Native 0.6+ mention it will link every library automatically. I also wrapped the DraggableFlatList with SafeAreaView and ScrollView. But the result is same.

Please let me know if i missed something.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:17

github_iconTop GitHub Comments

14reactions
pramodkumar005commented, Oct 30, 2020

I had similar problem as dragging was not working. So I changed MainActivity.java with the following marked things now it works perfectly.

23

4reactions
GraJa73commented, Feb 14, 2022

It worked for me to put my root inside a GestureHandlerRootView. Hope it helps you too

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix problem: Drag and drop not working in Windows
Drag and drop is no longer working in Windows 10 or Windows 11? Here's how to fix this problem in just a couple...
Read more >
12 quick fixes if you can't drag and drop in Windows 10/11
1. Run DISM tool · Click Start · In the search field box, type CMD · Click Command Prompt in the search results...
Read more >
Unable to drag and drop tasks in Outlook - Microsoft Community
Hello,. We are using Microsoft 365, and I have just installed Outlook on a new Windows 10 Pro laptop. Previously, I was able...
Read more >
Here's what to do if drag and drop stops working on a Mac
Quite simply, the act of moving the pointer using a mouse or trackpad, clicking and dragging a file or folder somewhere else, then...
Read more >
Can't drag files/folders in list view - Apple Community
Can't drag files/folders in list view. This has happened on two Macs now. Once on a 2x3Ghz Dual Core MacPro on 10.5 and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found