fermoya / SwiftUIPager

Native Pager in SwiftUI
MIT License
1.29k stars 172 forks source link

skip gesture if dragging in different axis #75

Closed mohammad-rahchamani closed 4 years ago

mohammad-rahchamani commented 4 years ago

check drag offset and skip if the user is dragging in another direction.

fixes #74

fermoya commented 4 years ago

I can still reproduce the issue... you can't just use the offset, you need to use the angle of the swipe and limit it.

Also, the offset (translation.value.width) keeps accumulating, even if the dragging is skipped, so when eventually back to swiping along the horizontal axis, the page is dragged "aggressively".

Screen Recording 2020-07-20 at 13.31.28.mov.zip