Xamarin.forms: [Bug] SwipeView is too sensitive - opens when scrolling

Created on 19 Oct 2020  Â·  7Comments  Â·  Source: xamarin/Xamarin.Forms

Hi.

Issue one: SwipeView is great. I use it for deleting chat messages and leaving chat rooms, by the user swiping left on a message or a chat. However, there seems to be absolutely no threshold for the swipe to happen, as it constantly opens whenever I scroll the list of chat messages or chat rooms. It is almost impossible to swipe perfectly vertically, so any even absolutely slight horizontal movement opens the swipe menu. The threshold value should be at least equal to a tap gesture recognisers default threshold value (and preferably scriptable) - because currently both a tap and swipe start open overlap.

This might sound like a small thing, but it completely breaks the experience as almost every scroll opens the swipe menu.

I think this would be a small fix that would make it immensely more usable so I am eagerly awaiting a fix for it.

Tested with latest XF 5 pre-release on iOS. I used the SwipeView in a bindable stack layout, enclosed in a scroll view.

Thank you.

collectionview swipeview in-progress iOS 🍎 bug

All 7 comments

Issue two: Another bug with the swipe menu, which is almost as bad, is that when you are scrolling a view and during that same scroll do a slight horizontal movement, the swipe menu starts opening.

If a vertical scroll is ongoing the swipe menu should not open. It should only open if the user starts with a horizontal swipe.

These issues are mostly apparent when using an actual device one-handedly, not so much with a mouse in the simulator.

Issue three: A third bug with the swipe view is that very often when you start scrolling and the swipe menu accidentally opens (as outlined in the initial message) and you stop scrolling, the UI breaks in two possible ways (seemingly randomly)
1) The item stays stuck in the position it would be as if the swipe view was visible, but it is not. Tapping, scrolling, nothing seems to bring it back.
2) The UI completely locks up and a restart of the app is required.

So to clarify:
1) You start scrolling a view vertically
2) Due to the sensitivity of the swipe view it opens on the first item (from right in my case)
3) You continue scrolling normally
4) The swipe view either disappears at this stage or stays visible
5) No matter if it disappears or not, the actual item stays on the left side, as if the swipe view item was visible
6) The UI may lock up

I think these are all related and possibly the same issue, can't say for sure.

I am positive that a repro with merely a list of items (enough to simulate a normal scrolling of content experience) and swipe view in all of them, when run on an actual device, is enough to repro all these issues. It is very important to do this on a real device, use it one handedly as people normally do and they should all be reproducible.

I also have a video that showcases all the above issues just by trying to scroll my scroll view. Please let me know where to send it in case it would be useful (don't want to post it publicly).

Thank you for a prompt fix!

Issue four: It a swipe view is open and you try to invoke it again (in my case swipe left again on an already opened swipe view), its animation glitches. Expected behavior is that the open swipe view gesture wouldn’t do anything if it’s already open.

Fix suggestions (in order of impact):
1) Add some threshold “resistance” before a swipe view goes into the above “opening swipe item” state. Resistance should be at least equal to the default tap gesture recognizer's fudge factor, and preferably scriptable.
2) Fix the state where a previously opened swipe view stays “open”, and the UI locks up.
3) Ignore panning in the direction that opens a swipe menu if it is already open, to prevent issue 4.
4) Lock the panning axes: if the user is scrolling vertically, no horizontal movement during that swipe should invoke the swipe view. Conversely if the user is opening the swipe menu, no vertical movement should scroll the view.

@jsuarezruiz Hi, I saw you added the collection view tag. This is not exclusive to collection views, I use bindable stack layouts with a scroll view. In fact I haven’t tested this with a collection view (updated the OP to say this).

Same as @Tommigun1980 , I do also encountered many times the "UI break" (not able to scroll anymore until I swipe an item).

My configuration :

  • SwipeView nested in a CollectionView
  • XF 4.8.0.1560
  • iOS 14
  • VS for Mac

This is how I'm able to reproduce it :

  1. Start swiping horizontally (I generally swipe half long of the phone width)
  2. Keep your finger pressed on the swiped item, and start scrolling up & down
  3. Release your finger

Up to this point :

  • there is a high percent of not being able to scroll anymore,
  • if I want to unlock my collectionview, I must swipe on an item before to scroll.

Thank you @jsuarezruiz for fixing the lock up issue. Is there a PR for the sensitivity issue yet or do you think it will also be fixed hopefully soonish? It is a real problem that panning a collection constantly opens the swipe view by accident, as it's so hard to do pixel perfect vertical swipes with your fingers on an actual device? It is almost inevitable to constantly open the swipe items by accident :(

Thank you so much for working so hard to fix these issues, we really appreciate it!

Was this page helpful?
0 / 5 - 0 ratings