Closed t1gor closed 3 years ago
Hey @t1gor this is definitely possible. You just need to pass a Touchable
as the top level component for visible content of the SwipeRow. Currently the top level component is a Box
. I believe something like this should work:
<SwipeRow
disableRightSwipe={isTeamChannel}
disableLeftSwipe={isTeamChannel}
onRowPress={() => onSelectedHandler()}
leftOpenValue={150}
rightOpenValue={-150}
ref={rowRef}
>
<SwipeHiddenItem
isArchived={isArchived}
isPinned={isPinned}
isMuted={isMuted}
markChannelFavorite={markChannelFavorite}
markChannelArchived={markChannelArchived}
markChannelAnswered={markChannelAnswered}
closeRow={() => rowRef.current?.closeRow()}
/>
<TouchableHighlight onLongPress={() => onLongPress()}> <===== ADD TOUCHABLE HERE
<Box width="100%" flexDirection="row" justifyContent="space-between">
<HStack justifyContent="space-between"
alignItems="stretch"
I just tested this myself and it is working, but if it is not for you please reopen this issue, thanks!
Thanks for the hint, @jemise111. My problem was that I was using TouchableOpacity
instead of TouchableHighlight
and it was producing weird effect - I could see the swipe actions while doing the long press on the item :) Probably worth mentioning in the docs for newbies, like myself ;)
Gotcha, glad you got it sorted. I'll try to add that but PRs are always welcome, especially for docs :)
Hello,
First of all - great job with the lib, thanks a lot for all your efforts!
I would like to add an
onLongPress
handler forSwipeRow
. I could not find any API within the lib so far, maybe I'm missing something?What would be the way to achieve it?
My sample row code: