Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging only when holding tap on an area #205

Open
MarioUnlam opened this issue Nov 9, 2020 · 0 comments
Open

Dragging only when holding tap on an area #205

MarioUnlam opened this issue Nov 9, 2020 · 0 comments

Comments

@MarioUnlam
Copy link

I have a list which should be sortable. Each element has a button on the left. When the user holds the finger on that button, the item should be draggable, but not when tapping or holding anywhere else. I can't make this work.

I set manuallyActivateRows to true, and modified the plugin so it properly exposes the "setScrollEnabled" function. I put that function inside a TouchableX, and the element becomes active. But I cannot make it active AND drag at the same time. I need to tap first to activate it, and then drag the element again to change the order. I tried using PanHandlers with these parameters:

onPanResponderGrant: (evt, gestureState) => {
	if (active) return;
	toggleRowActive(evt, gestureState);
},
onPanResponderMove: (evt, gestureState) => {
},
onPanResponderTerminationRequest: (evt, gestureState) => {
	if (active) {
		return false;
	}

	return true;
},
onPanResponderRelease: (evt, gestureState) => {
	if (active) {
		toggleRowActive(evt, gestureState);
	}
},
onPanResponderTerminate: (evt, gestureState) => {
	if (active) {
		toggleRowActive(evt, gestureState);
	}
},

But it does the same. It activates when I tap, and deactivates when I tap again. Is there any way to accomplish what I want?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant