Filed as FB23362414, with a minimal sample: https://github.com/mesqueeb/Swiftui-Gesture-Detection-Failures
While a SwiftUI DragGesture is held (trackpad click-drag), a two-finger magnify (trackpad pinch) permanently cancels it:
onChangedstops firing the instant the magnify is recognized.onEndedis never delivered — the gesture is torn down with no terminal event.- Continued motion of the same, still-pressed finger after the pinch is not re-detected.
The drag only recovers after a full release and re-press. Throughout, the AppKit NSEvent stream keeps delivering .leftMouseDragged (and a clean .leftMouseUp on release), so the OS is still tracking the drag — it's SwiftUI's gesture arbitration that discards it. No gesture composition avoids this: .simultaneousGesture, .highPriorityGesture, varying gesture order, and .exclusively(before:) in both directions were all tried; none delivers a terminal onEnded or resumes the drag after the pinch.
Steps to reproduce (full sample in the repo — ./build.sh run):
- Press-hold and drag a shape with the trackpad (do not release).
- Without lifting the drag finger, perform a two-finger pinch.
- End the pinch and keep moving the same finger.
Expected: onChanged continues for the still-pressed finger; onEnded fires when it's lifted.
Actual: onChanged stops at the pinch and never resumes; onEnded never fires.
Workaround: driving the gestures off AppKit NSEvent instead of SwiftUI works correctly — the sample has a toggle to switch between the two so you can compare side by side.
Tested on macOS 26.3.1 (25D771280a) and macOS 27.0 Beta (26A5353q), Apple Silicon, built-in trackpad.
Has anyone else run into this, or found a SwiftUI gesture composition that survives the pinch?