React-native-draggable-flatlist: Clickable icon on each item doesn't work

Created on 30 Nov 2019  路  12Comments  路  Source: computerjazz/react-native-draggable-flatlist

I'm using this library in my application and I'm struggling to using icon click with popover kindof thing in the code, the click doesn't work but on reorder it shows the popover where the icon was clicked
Please find below the screenshot

Most helpful comment

Same here.. Trying to find a workaround, will update if I find anything.

EDIT : Using onPressOut instead of onPress seems to be working for me. That's only a workaround though.

All 12 comments

image

i am struggling with the same problem. onPress function does not work for list items. When i change draggable list to flatlist, onPress function works i expect.

Same here.

It works on iOS, but not on Android

Same experience on Android. When using a Touchable element inside of renderItem(), any onPress action stops working. The existence of onLongPress={drag} doesn't seem to matter, the other touches won't work regardless.
The Touchable elements still give visual feedback of being pressed, but stop executing any action.

Same here.. Trying to find a workaround, will update if I find anything.

EDIT : Using onPressOut instead of onPress seems to be working for me. That's only a workaround though.

Same here.. Trying to find a workaround, will update if I find anything.

EDIT : Using onPressOut instead of onPress seems to be working for me. That's only a workaround though.

Thanks. It worked.

using react-native-gesture-handler -> Touchables instead of react-native -> Touchables

using react-native-gesture-handler -> Touchables instead of react-native -> Touchables

Doing this, I run into a different issue involving nesting. If you want the entire item to be touchable, along with certain buttons within that item, you run into this bug in react-native-gesture-handler: https://github.com/software-mansion/react-native-gesture-handler/issues/784

Anyone have a workaround for that?

@computerjazz still a problem only on android

Does anyone understand why the presses on normal react-native Touchables are being cancelled by react-native-gesture-handler on Android? I think that could help narrow down a solution or at least work around.

I have noticed that a quick tap does not fire the onPress callback, BUT, a somewhat longer tap DOES! However, this does not appear to be related to onLongPress.

thanks, closing in favor of https://github.com/computerjazz/react-native-draggable-flatlist/issues/120 as they are duplicates and there's more context on that issue

Same here.. Trying to find a workaround, will update if I find anything.

EDIT : Using onPressOut instead of onPress seems to be working for me. That's only a workaround though.

OnPressOut is triggering when you try to drag an item.
Ex. If you attach an navigate into the "OnPressOut" you can't be drag item because navigate is triggering.

Was this page helpful?
0 / 5 - 0 ratings