aheze / SwipeActions

Add customizable swipe actions to any view.
https://twitter.com/aheze0/status/1646399867764510721
MIT License
1.08k stars 46 forks source link

Scroll doesn't work in the example app #8

Open arietis opened 1 year ago

arietis commented 1 year ago

Whenever I try to scroll up or down in the example app, it only works if I use the left or right edge of the screen. Does it work inside scroll views?

MirzayevFarid commented 1 year ago

+1

joshgalvan commented 1 year ago

I am also not able to place a SwipeView with a SwipeAction inside a ScrollView without the ScrollView not being able to be moved at all. It seems the placement of the SwipeView in a ScrollView overrides any vertical gesture detection, only capturing horizontal gesture movement for the SwipeView that you initially started your gesture on.

If you add enough padding between SwipeViews in a ScrollView you can press between the SwipeViews and get the ScrollView to detect the vertical movement of your gesture. How to stop the SwipeView from overriding vertical movement detection by the ScrollView? Not sure...

It may have to do something with line 442, where highPriorityGesture() is used, which overrides other gestures currently available?

EDIT: I fixed my issue by modifying the SwipeView with .swipeMinimumDistance(20). For my situation this seemed to work well and not interfere with the ScrollView. I feel like this should be default behavior though.

minho-park commented 1 year ago

I think we should use gesture() instead of highPriorityGesture() of line 442. It doesn't need highPriority.

freak4pc commented 7 months ago

Just bumped into this and wanted to highlight this solved the issue for me as well :) 2 is a very small number as a default IMO

EDIT: I fixed my issue by modifying the SwipeView with .swipeMinimumDistance(20). For my situation this seemed to work well and not interfere with the ScrollView. I feel like this should be default behavior though.