Fix touch gestures cancelling, backward flicks, and late onCommit

- Only the host's own lostpointercapture cancels a gesture. Taking
  capture makes the touched child lose its implicit touch capture, and
  that bubbling event was cancelling every touch gesture immediately.
- A flick at least commitVelocity fast now decides by its direction:
  backward cancels even past the distance threshold, forward commits.
  Slower releases still decide by distance.
- Pointer-up finishes an already-begun operation without awaiting, so
  onCommit runs inside the pointer-up event, where iOS still allows
  haptics, audio, and clipboard writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Faarh2Ts6StJPcz2mRiHiR
This commit is contained in:
Claude
2026-10-31 05:41:51 +00:00
parent 7033814550
commit d4d7feb3b7
5 changed files with 112 additions and 22 deletions
+9 -6
View File
@@ -582,13 +582,16 @@ can run repeatedly during rendering and animation.
### Commit thresholds
When `finish()` does not explicitly override the decision, a target commits
when either:
When `finish()` does not explicitly override the decision, the release velocity
decides first, then distance:
- `progress >= commitThreshold`, default `0.36`; or
- release `velocity >= commitVelocity`, default `0.3` progress units per
second, at any progress. Velocity is normalized by the gesture host's size,
so `1` is one full width (or height) per second.
- a flick at least `commitVelocity` fast (default `0.3` progress units per
second) decides by its direction: forward commits, backward cancels,
regardless of progress;
- a slower release commits when `progress >= commitThreshold`, default `0.36`.
Velocity is normalized by the gesture host's size, so `1` is one full width (or
height) per second.
The operation's intent becomes final before its spring settles.