Repository navigation
Snap a gesture area's pan, and keep a one-axis pan off the other axis on iOS - #183
Merged
Merged
Conversation
… on iOS A bound pan axis with snap points (pan-x-snap / pan-y-snap, from the gesture area's snap-x / snap-y) follows the finger between its lowest and highest point, with resistance past them, and on release springs to the point nearest where the fling would carry it. @Dragend reports that point. A PHP write-back on a snapping axis springs there too, so closing a revealed row from PHP slides it shut. Both platforms use the 350 ms ease-out the bounded pan already settles with. On iOS a pan bound on one axis now uses a UIKit pan that only begins when the finger first moves along that axis. SwiftUI's drag claimed every touch from touch-down, so a vertical scroll view couldn't scroll when the drag started on the area. An enclosing scroll view and iOS 26's swipe back from mid-screen wait for this pan to decide; the edge swipe back still wins. Android's one-axis drag already behaved this way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Two changes to the gesture area's pan, needed for a swipe-to-reveal row that follows the finger (NativePHP/dev-null-app#102).
Snap points
With
pan-x-snap/pan-y-snap(from the gesture area's newsnap-x/snap-yin mobile-air, branch feat/gesture-area-snap), a bound axis:@dragEnd;setValue()on a persistent SharedValue) too, so closing a revealed row from PHP slides it shut instead of jumping.Both platforms use the 350 ms ease-out the bounded pan already settles with. An axis without snap points behaves as before.
iOS: a one-axis pan only takes drags along its axis
A gesture area with only
pan-x(or onlypan-y) bound, and noboundedor pinch, now uses a UIKit pan that begins only when the finger first moves along that axis. SwiftUI'sDragGesture(minimumDistance: 0)claimed every touch from touch-down, so a vertical scroll view couldn't scroll when the drag started on the area. Android's one-axis drag already worked this way (detectHorizontalDragGestures).interactiveContentPopGestureRecognizer), wait for this pan to decide. A sideways drag on a row moves the row; it doesn't scroll the list or pop the screen.interactivePopGestureRecognizer.@dragEndstill reports the unbound axis as the finger's raw movement.Worth a look
GestureAreaRenderer.kt) isn't checked on a device or emulator yet: the snap and write-back code mirrors iOS, and the one-axis drag already existed.🤖 Generated with Claude Code