You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bd95cd6
Browse filesBrowse the repository at this point in the historyBrowse files
feat(ContextMenu): open from a held finger on iOS 26's timeline
The trigger grows from 150 ms on UIKit's measured press curve, played on
the compositor from the touch's own timestamp. The click haptic plays at
the 400 ms commit. The menu opens at 735 ms for a finger still down, or
at a lift after the commit. A lift before the commit, a second finger, a
scroll, or a drift past 11.5 px on either axis before the menu gets no
menu, and the trigger springs back. The commit claims the finger: no
click from the lift and no page scroll under it. The page stays put
while the menu is up.
[feat] ContextMenu opens from a held finger on iOS 26's timeline. The trigger starts to grow at 150 ms, following UIKit's measured press curve on the compositor. At 400 ms the click haptic plays where the browser can vibrate, and 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. Android's own long-press menu no longer opens a second menu.
Copy file name to clipboardExpand all lines: apps/storybook/stories/ContextMenu.stories.tsx
+44Lines changed: 44 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -589,3 +589,47 @@ export const InScrollContainer: Story = {
589
589
</div>
590
590
),
591
591
};
592
+
593
+
consttouchStyles=stylex.create({
594
+
card: {
595
+
width: '200px',
596
+
height: '120px',
597
+
display: 'grid',
598
+
placeItems: 'center',
599
+
borderRadius: '12px',
600
+
backgroundColor: '#e5e7eb',
601
+
color: '#374151',
602
+
userSelect: 'none',
603
+
},
604
+
});
605
+
606
+
exportconstTouchLongPress: Story={
607
+
name: 'Touch / long press',
608
+
parameters: {
609
+
docs: {
610
+
description: {
611
+
story:
612
+
'On a touch screen, hold a finger on the card. As on iOS, it starts to grow after 150 ms, a haptic plays at 400 ms where the device can play one, and the menu opens at 735 ms, or as soon as the finger 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 card springs back. While the menu is up the page stays still, and the card returns to its size when the menu closes.',
Copy file name to clipboardExpand all lines: packages/core/src/ContextMenu/ContextMenu.doc.mjs
+18-3Lines changed: 18 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,7 @@ export const docs = {
160
160
usage: {
161
161
anatomy,
162
162
description:
163
-
'A right-click context menu that appears at the cursor position. Use to provide contextual actions for specific elements or regions without cluttering the UI with visible buttons.',
163
+
'A right-click context menu that appears at the cursor position. Use to provide contextual actions for specific elements or regions without cluttering the UI with visible buttons. On a touch screen a held finger opens it with iOS timing: the trigger starts to grow at 150 ms, a haptic plays at 400 ms where the device can play one, and the menu opens at 735 ms, or as soon as the finger lifts after 400 ms.',
164
164
bestPractices: [
165
165
{
166
166
guidance: true,
@@ -187,6 +187,11 @@ export const docs = {
187
187
description:
188
188
'Keep a visible MoreMenu or equivalent trigger for important mobile actions; long-press must not be the only route.',
189
189
},
190
+
{
191
+
guidance: true,
192
+
description:
193
+
'Leave a little room around a block trigger: a held finger grows it from its center, by about 6%, until the menu closes.',
'A right-click context menu that appears at the cursor position. Use to provide contextual actions for specific elements or regions.',
273
+
'A right-click context menu that appears at the cursor position. Use to provide contextual actions for specific elements or regions. Touch: a held finger opens it at 735 ms, or on a lift after 400 ms (iOS timing); the trigger grows from 150 ms.',
264
274
bestPractices: [
265
275
{guidance: true,description: 'Keep items concise and action-oriented.'},
266
276
{
@@ -281,6 +291,11 @@ export const docsDense = {
281
291
guidance: true,
282
292
description: 'Keep a visible mobile entry point for important actions.',
283
293
},
294
+
{
295
+
guidance: true,
296
+
description:
297
+
'Leave room around a block trigger: a held finger grows it about 6%.',
298
+
},
284
299
{
285
300
guidance: false,
286
301
description: 'Use as the only way to access important actions.',
0 commit comments