Home

longpress

Longpress, or long-press, is a gesture used primarily on touch-enabled devices in which the user places a finger on a screen and maintains contact for a short duration before an action is triggered. The exact threshold varies by platform and context but is commonly in the range of about 500 to 800 milliseconds.

Uses include revealing a context menu, initiating drag-and-drop, selecting items, editing text, previewing content, or triggering

Implementation varies: on Android, a long-click listener can be attached to a view to react to long

Accessibility considerations include providing keyboard or mouse equivalents, such as right-click context menus or dedicated shortcuts;

Designers should balance responsiveness with prevention of accidental activations, and test across devices to ensure consistent

tool
modes
in
apps.
In
many
interfaces,
a
long-press
differs
from
a
tap
(brief
touch)
and
from
a
double-tap;
it
may
also
conflict
with
vertical
scrolling,
so
designers
often
require
a
deliberate
hold
and
may
provide
visual
or
haptic
feedback.
presses;
on
iOS,
a
UILongPressGestureRecognizer
detects
the
gesture;
in
web
and
cross-platform
frameworks,
long-press
can
be
implemented
using
a
timer
on
touchstart/pointerdown
and
canceled
on
touchmove
or
touchend.
Some
systems
also
expose
native
long-press
behaviors
such
as
opening
a
context
menu
or
drag
handles.
ensure
the
gesture
is
cancelable
and
does
not
impede
primary
actions,
and
consider
providing
settings
to
disable
or
customize
the
duration.
behavior.