Skip to content

Commit 883bf8e

Browse files
committed
docs(ContextMenu): the changesets and useLongPress's page follow ContextMenu onto the context request
ContextMenu no longer runs useLongPress or a recognizer of its own, so the sentences that said so change: its touch timeline's changeset says the hold runs on the trigger's context request, useLongPress's stages and one-source changesets no longer name ContextMenu, and the hook's header and page say ContextMenu and createContextMenu open on their trigger's own request. A new changeset says ContextMenu opens through that request and yields to a gesture that has already claimed the finger.
1 parent 65fa39d commit 883bf8e

6 files changed

Lines changed: 12 additions & 6 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[chore] ContextMenu opens through its trigger's context request, the path `createContextMenu` uses: a right click, Shift+F10 or the context-menu key, or a finger's or a pen's hold, once per gesture. Its hold follows the request's rules, so it yields to a gesture that has already claimed the finger.
6+
7+
@vjeux

‎.changeset/contextmenu-touch-timeline.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
'@astryxdesign/core': patch
33
---
44

5-
[feat] ContextMenu opens from a held finger on iOS 26's measured timeline, on every touch device (a coarse primary pointer, iOS and Android alike). The trigger starts to grow at 150 ms (the onset of core's one press machine), following UIKit's measured press curve on the compositor, and the hold runs on useLongPress's detector with UIKit's measured moments. At 400 ms the press takes the finger: its lift no longer sends a click, and the page cannot scroll under it. The menu opens at 735 ms if the finger is still down, or as soon as it lifts after 400 ms. A finger that lifts before 400 ms, or drifts more than 11.5 px on either axis before the menu opens, gets no menu, and the trigger springs back. The page stays still while the menu is up, and the trigger returns to its size when the menu closes. A touch open lights no row: the menu takes the focus, and a row lights only under the finger, as in UIKit (keyboard and pointer opens still focus the first item). A second finger cancels the press, and Android's own long-press menu no longer opens a second menu. A fine pointer (a mouse) keeps the right-click menu, and the touch recognizer stays off there.
5+
[feat] ContextMenu opens from a held finger on iOS 26's measured timeline, on every touch device (a coarse primary pointer, iOS and Android alike). The trigger starts to grow at 150 ms (the onset of core's one press machine), following UIKit's measured press curve on the compositor, and the hold runs on the trigger's context request with UIKit's measured moments. At 400 ms the press takes the finger: its lift no longer sends a click, and the page cannot scroll under it. The menu opens at 735 ms if the finger is still down, or as soon as it lifts after 400 ms. A finger that lifts before 400 ms, or drifts more than 11.5 px on either axis before the menu opens, gets no menu, and the trigger springs back. The page stays still while the menu is up, and the trigger returns to its size when the menu closes. A touch open lights no row: the menu takes the focus, and a row lights only under the finger, as in UIKit (keyboard and pointer opens still focus the first item). A second finger cancels the press, and Android's own long-press menu no longer opens a second menu. A fine pointer (a mouse) keeps the right-click menu, and UIKit's timeline stays off there.
66

77
@vjeux

‎.changeset/long-press-one-source.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
'@astryxdesign/core': patch
33
---
44

5-
[chore] Internal: `useLongPress` (ContextMenu's long press, and the held finger that opens a menu from its trigger) takes its default duration and tolerance, 500ms and 10px on either axis, from the same source as the long-press gesture recognizer. No behavior changes.
5+
[chore] Internal: `useLongPress` (the held finger that opens a menu from its trigger) takes its default duration and tolerance, 500ms and 10px on either axis, from the same source as the long-press gesture recognizer. No behavior changes.
66

77
@vjeux

‎.changeset/uselongpress-stages.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
'@astryxdesign/core': patch
33
---
44

5-
[feat] useLongPress takes `stages`: later moments of the same hold, each fired once the finger has stayed that long from the start and still within `moveCancelPx`. ContextMenu claims the finger at its long press and shows its menu at a later stage. `start` also takes the press's start time, so the deadlines can count from a touch's own timestamp.
5+
[feat] useLongPress takes `stages`: later moments of the same hold, each fired once the finger has stayed that long from the start and still within `moveCancelPx`. `start` also takes the press's start time, so the deadlines can count from a touch's own timestamp.
66

77
@vjeux

‎packages/core/src/hooks/useLongPress.doc.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const docs = {
6565
],
6666
usage: {
6767
description:
68-
'Detects a single-finger press-and-hold and reports where it happened, so touch users can reach affordances that a pointer gets from right-click. iOS Safari never synthesizes a contextmenu event on long-press, which makes this the only touch route into a cursor-positioned surface such as ContextMenu. The press cancels on movement, lift, multi-touch or unmount.',
68+
'Detects a single-finger press-and-hold and reports where it happened, so touch users can reach affordances that a pointer gets from right-click. iOS Safari never synthesizes a contextmenu event on long-press, which makes this the touch route into a cursor-positioned surface you build; ContextMenu and createContextMenu open on their trigger\u2019s own context request, a held finger included. The press cancels on movement, lift, multi-touch or unmount.',
6969
bestPractices: [
7070
{
7171
guidance: true,

‎packages/core/src/hooks/useLongPress.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
* driven by hand for a caller already observing pointer events; the
1111
* detector itself (createLongPressDetector) for a caller with its own clock
1212
* @position Core hook for long-press invocation; used by `useMenuPress` for
13-
* the held-finger menu open, and (as createLongPressDetector, on the gesture
14-
* arena's clock) by ContextMenu's press recognizer
13+
* the held-finger menu open
1514
*
1615
* SYNC: When modified, update the hooks barrel /packages/core/src/hooks/index.ts
1716
*

0 commit comments

Comments
 (0)