react-native-swipe-list-view icon indicating copy to clipboard operation
react-native-swipe-list-view copied to clipboard

Swipe quickly makes the swipe buggy.

Open XavierColombel opened this issue 8 years ago • 28 comments

When you swipe quickly rows one by one (without scrolling the ListView, be careful), the swipe becomes really buggy at a time: the swipe is blocked, you can't discover buttons behind rows. Then if you scroll up/down a bit the ListView, it unblocks the swipe. You can reproduce this bug using the example file, I've tested it on iOS devices (iPad, iPhone).

XavierColombel avatar Jul 04 '16 10:07 XavierColombel

I have also experienced that from time to time on iOS.

thorbenandresen avatar Jul 04 '16 14:07 thorbenandresen

me too

inetfuture avatar Jul 05 '16 06:07 inetfuture

@pixelgamma @Thorbenandresen @inetfuture Thanks for reporting. This is something I haven't been able to solve and could definitely use some help. I believe this is the same issue as when you delete one of the last rows in the ListView.

With some logging, my theory is that the onScroll event in the ListView is (incorrectly) being triggered, which overrides the panResponder and doesn't allow the row to open. I've tried to replicate what's going on in the screen grab below.

I'm logging the onScroll event from the ListView in the SwipeListView. You'll see it log correctly until I delete a row, then every time I try to open a row the onScroll event fires, causing the row to close. Once I scroll, everything is back to normal.

If anyone has any ideas as to what might cause this let me know and I'll investigate further, or submit a PR if you can. Thanks!

jemise111 avatar Jul 06 '16 14:07 jemise111

I alse met on IOS,I found that panResponder of row was replaced by listview's every time cannot slide.

snibib avatar Jul 08 '16 15:07 snibib

I am not good at English,so please don't mind.I found a solution which may can give some help.I found when the row cannot slide,the responder was replaced by listview via setScrollEnabled in SwipeRow.js.So I have done something here. `handleOnPanResponderRelease(e,gs) { this.handleOnPanResponderEnd(e,gs,true); }

handleOnPanResponderTermination(e,gs) { this.handleOnPanResponderEnd(e,gs,false); }

handleOnPanResponderEnd(e,gs,release) { if (!this.parentScrollEnabled && release) { this.parentScrollEnabled = true; this.props.setScrollEnabled && this.props.setScrollEnabled(true); }` just like this,and it can solve my problem!

snibib avatar Jul 11 '16 03:07 snibib

@snibib Can you post the file?

KishPatel1996 avatar Jul 14 '16 13:07 KishPatel1996

Also experiencing this issue. Happy to try out any potential solutions.

jdmunro avatar Jul 16 '16 16:07 jdmunro

@KishPatel1996 Sorry to reply so late.I found it didn't work so nice.It just seldom happens.

snibib avatar Jul 27 '16 09:07 snibib

componentWillMount() { this.panResponder = PanResponder.create({ onMoveShouldSetPanResponder:(e,gs) => this.handleOnMoveShouldSetPanResponder(e,gs), onPanResponderMove:(e,gs) => this.handleOnPanResponderMove(e,gs), onPanResponderRelease:(e,gs) => this.handleOnPanResponderRelease(e,gs), onPanResponderTerminate:(e,gs) => this.handleOnPanResponderTermination(e,gs), onShouldBlockNativeResponder: => false }); } when you stopped moving,onPanResponderRelase happened.but if you was stopped moving,onPanResponderTerminate happened,so I created two functions for each.

snibib avatar Jul 27 '16 10:07 snibib

Changing

onPanResponderTerminate:(e,gs) => this.handleOnPanResponderTermination(e,gs),

to

onPanResponderTerminationRequest:() => false,

worked for me. Perhaps a bit heavy-handed.

dangerwells avatar Sep 07 '16 23:09 dangerwells

@dangerwells Thanks, it's worked for me.

xwartz avatar Nov 08 '16 09:11 xwartz

@dangerwells But it's not perfect, the scrollbar can't recover auto.

xwartz avatar Nov 08 '16 10:11 xwartz

I have the same problem, anyone have a solution?

lBroth avatar Dec 18 '16 10:12 lBroth

Any other ideas about this one? I'm having the same issue. Is there something we can disable for the time being that would fix it?

coderdave avatar Dec 25 '16 18:12 coderdave

@snibib can you post the whole SwipeRow.js file? You're referencing functions that don't exist.

coderdave avatar Dec 25 '16 18:12 coderdave

I'm having the same issue here.

oximer avatar Jan 11 '17 10:01 oximer

@jemise111

I have got the same issue, and this issue is happening because of this part code in SwipeRow:

line 150
this.props.setScrollEnabled && this.props.setScrollEnabled(false);

By default, in SwipeListView it will do this:

setScrollEnabled(enable) {
		this._listView.setNativeProps({scrollEnabled: enable});
	}

In iOS, when you set it's disable, then touch event stopped too.

https://developer.apple.com/reference/uikit/uiscrollview/1619395-isscrollenabled

I am not fully confirmed the Native props of scrollEnabled is isScrollEnabled in iOS, but by it's explanation:

If the value of this property is true , scrolling is enabled, and if it is false , scrolling is disabled. The default is true.

When scrolling is disabled, the scroll view does not accept touch events; it forwards them up the responder chain.

it probably stopped the touch events accidentally, then before we even swipe it to that distant, it stopped.

By comment the line

this.props.setScrollEnabled && this.props.setScrollEnabled(false);

The default SwipeListView running just ok.

More explanation and if it will bring some side-effect, still unknown.

hellomaya avatar Mar 17 '17 16:03 hellomaya

+1 @jemise111

I have got the same issue, and this issue is happening because of reloading the same listview in the canvas. It was not consistent, but it happens quite often.

jjhesk avatar Apr 04 '17 03:04 jjhesk

Any resolution of the issue? I experience it quite often and I have to scroll within my ListView in order to get the swiper to work again.

jonolock91 avatar Apr 09 '17 19:04 jonolock91

Any resolution of the issue? @hellomaya Did you resolve it without side-effect?

gxhx avatar Apr 27 '17 08:04 gxhx

Any resolution of the issue? Thanks

YogeshYo avatar Dec 08 '17 06:12 YogeshYo

The same for me with latest version. In my case, the hidden row sometimes didn't show at all (the item does not slide at all), and that some other next try make it work but then the issue happen again. This bug is anoying not only for client but also for developer :(

@jemise111 , Can you please fix this?

ithieund avatar May 25 '18 04:05 ithieund

Anyone found a solution for this issue??

Uzama avatar Mar 26 '19 17:03 Uzama

Is this now resolved can we use this package in production. I hope my ipa will not become buggy. Please resolve it fast if not resolved!!

mufaddalhamidofficial avatar Aug 27 '19 17:08 mufaddalhamidofficial

@mufaddalhamidofficial unfortunately it was not. I also spotted that occasionally swiper becomes buggy and when swiping instead of opening it will just go nuts and go all the way to the left or right and then close immediately.

ThomasFindlay avatar Oct 14 '19 18:10 ThomasFindlay

Is this still unfixed ? (2020)

kopax avatar Feb 09 '20 12:02 kopax

@kopax This has been reported periodically across versions so I leave the issue open in case people have ideas how to solve

jemise111 avatar Feb 11 '20 17:02 jemise111

Hey guys this issue is an old one, I found the fix for iPhone X and above (I don't know the fix if you guys are getting on other iOS devices), where the issue was found initially for me. I gave a bottom margin of 40 which avoids the bottom menu/nav bar (For the lack of correct term 😉 ). And now the issue is resolved for me. I don't know how this padding/margin fix makes it work, but the issue is now fixed for me. Hope it helps someone!

Hey @jemise111, Can you please look into the cause now that the padding/margin on the bottom is resolving the issue? Thanks in advance.

KiranCNayak avatar Oct 06 '20 11:10 KiranCNayak