react-native-swipe-list-view
react-native-swipe-list-view copied to clipboard
Swipe quickly makes the swipe buggy.
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).
I have also experienced that from time to time on iOS.
me too
@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!
I alse met on IOS,I found that panResponder of row was replaced by listview's every time cannot slide.
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 Can you post the file?
Also experiencing this issue. Happy to try out any potential solutions.
@KishPatel1996 Sorry to reply so late.I found it didn't work so nice.It just seldom happens.
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.
Changing
onPanResponderTerminate:(e,gs) => this.handleOnPanResponderTermination(e,gs),
to
onPanResponderTerminationRequest:() => false,
worked for me. Perhaps a bit heavy-handed.
@dangerwells Thanks, it's worked for me.
@dangerwells But it's not perfect, the scrollbar can't recover auto.
I have the same problem, anyone have a solution?
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?
@snibib can you post the whole SwipeRow.js
file? You're referencing functions that don't exist.
I'm having the same issue here.
@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.
+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.
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.
Any resolution of the issue? @hellomaya Did you resolve it without side-effect?
Any resolution of the issue? Thanks
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?
Anyone found a solution for this issue??
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 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.
Is this still unfixed ? (2020)
@kopax This has been reported periodically across versions so I leave the issue open in case people have ideas how to solve
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.