---
name: gesture-fallbacks
description: "Implement bounded pointer gestures with cancellation and keyboard alternatives. Use for pointer capture, drag, swipe, accessibility."
---

# Жесты и управление без мыши

Implement bounded pointer gestures with cancellation and keyboard alternatives.

## Implementation decisions

1. Use pointer capture during drag and clear the gesture on pointerup and pointercancel.
2. Clamp display displacement and commit only after an explicit threshold. Keep the underlying data unchanged during a tentative drag.
3. Set touch-action on the draggable surface only, leaving surrounding page scrolling native.
4. Offer arrows or action buttons that achieve the same result without drag. Preserve accessible names and visible focus.

## Working source

Read [components/advanced-motion.tsx](../webcraft-shared/source/components/advanced-motion.tsx) when implementing this capability. The example belongs to the WEBCRAFT React/Three.js playground except the Python commerce starter, which runs without third-party dependencies. Use [shared catalog](../webcraft-shared/source/lib/catalog.ts) only to resolve related examples. Adapt the source to the target framework and preserve existing project conventions.

## Verify observable behavior

- Leaving the hit area while captured does not strand the gesture.
- Cancelled gestures return to a valid state.
- Every drag-only result has an equivalent keyboard action.

## Scope

Use only the parts relevant to the requested task. This skill does not grant permission to publish, spend money, change account access or expose secrets. The original brief and environment rules remain authoritative.

Version 2.0.0 · Original WEBCRAFT content · MIT
