Repository navigation
Conversation
…eep scrolling A zero-distance DragGesture attached with simultaneousGesture claims the touch before an enclosing ScrollView can start panning, so a swipe that starts on any element with press-scale / press-opacity / press-translate-y never scrolls (reproduced on iOS 27.0.1). Press state now comes from a zero-duration UILongPressGestureRecognizer bridged through UIGestureRecognizerRepresentable (public since iOS 18, the deployment target is 18.2): it recognizes simultaneously with every gesture, never cancels or delays touches, and releases the press on lift, on cancel, or once the finger has moved past tap slop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #394, this time without any private API.
What's wrong
On iOS, a swipe that starts on an element with
press-scale,press-opacityorpress-translate-ydoesn't scroll. On a screen full of pressable cards, you can only scroll by aiming at the gaps between them.Reproduced on an iPhone 16 Plus running iOS 27.0.1, so it isn't limited to old iOS versions.
Why
To know when a finger is down, the press effect listens for a "drag" that starts at zero distance. iOS hands the touch to that drag first, so the scroll view never gets it.
What this does
It swaps that drag for iOS's standard touch listener (a long-press recognizer with a 0 s duration) that only watches the finger: it never takes the touch away from the scroll view,
@press,@tapor long-press. The effect goes away when the finger lifts, or once it moves far enough to be a scroll.UIGestureRecognizerRepresentable, iOS 18+; the app's minimum is already 18.2)How to reproduce
Four kinds of cards: pick one at the top, then start a swipe on a card.