LongPressDetector

Primitive #48

🔍 Problem it solves

Mobile users expect long press (hold) to trigger context menus or actions (e.g., save image). Distinguishing long press from a normal click requires timer logic and touchmove cancellation.

✅ Solution

LongPressDetector listens for press start, sets a timer, and triggers onLongPress after a configurable delay. It cancels if the user moves or releases early. Works with both mouse and touch.

🧩 Used by components

ContextMenuOnMobile, ActionSheetTrigger, DragStartOnTouch, CopyText

🎮 Interactive demo