Skip to content

fix(useMenuPress): a finger that begins on a row claims its moves - #12880

Draft
cixzhang wants to merge 3 commits into
mainfrom
fix/menu-press-row-begun-claims
Draft

cixzhang wants to merge 3 commits into
mainfrom
fix/menu-press-row-begun-claims

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Primary intent

A finger that starts on a row of an open menu whose rows fit claims its moves, as a press that opened the menu from its trigger does, so its lift stays cancelable.

User impact

  • People who press a row of an open menu with a finger and slide or lift: the menu claims that finger, as it already does for a press that opened it from its trigger, so its lift stays cancelable and its native click cannot reach the page underneath. A product team reported that on Android Chrome 153 and later the browser delivered such a lift's touchend uncancelable after uncancelled moves, so the page could not stop it.
  • Builders of press-slide-release lists on useMenuPress: no workaround is needed for a row-begun press.
  • Everyone else: unchanged. A menu that scrolls, and a bottom-sheet menu whose sheet scrolls, keep their native pan, a second finger still ends the gesture and leaves pinch-zoom to the browser, and a mouse press is untouched.

Cause

useMenuPress installed its document touchmove preventer only when a held finger opened the menu from its trigger. A press that began on a row went straight to tracking and left its moves uncancelled. That leaves the claim incomplete under spec:AST-094 FR19, whatever a given browser then does with the lift; the reported symptom is Chrome 153+ making the lift's touchend uncancelable (touchend.cancelable false after an uncancelled move).

Change

  • useMenuPress.ts: a row-begun press by a finger or pen installs the same preventer only when the menu's own computed touch-action leaves no one-finger pan (a menu whose rows fit declares pinch-zoom). A scrolling menu (pan-y pinch-zoom) and a list in a bottom-sheet menu, whose sheet body scrolls (auto), keep their pan. It comes off when the gesture ends.
  • useMenuPress.test.tsx: three cases (a pinch-zoom menu cancels the moves until the lift; pan-y pinch-zoom and auto menus keep them; a mouse cancels none), with the menu's touch-action set through a stub that afterEach restores.
  • MenuPress.a11y.chromium.spec.ts: two real-Chromium touch cases: a finger lands on Edit, slides to Delete and lifts (every move and the lift cancelled, Delete acts once); and a 110 px swipe up from a row of the bottom-sheet menu story scrolls the sheet and acts on nothing.
  • useMenuPress.spec.md: one verification row (FR4, row-begun finger).
  • Changeset: [fix] patch.

Authority

  • spec:AST-094 FR19: a recognizer that claims a touch mid-gesture registers a blocking touchmove listener for it. A row-begun press in a fitting menu is that claim, so main cancelling none of its moves is FR19 failing, whether or not a given browser build then makes the lift uncancelable.
  • spec:AST-094 FR21: when a gesture takes a touch, its touchend MUST be cancelled and no click reaches the page.
  • module:DropdownMenu/useMenuPress FR4 (a scrolling menu keeps its pan; a second pointer ends the gesture) and FR5.

Evidence

Case main this PR
unit: a row-begun finger in a fitting menu has its moves cancelled fails passes
real Chromium touch: moves of a row-begun finger cancelled fails (0 of 5) passes (5 of 5), lift cancelled, Delete acts once
real Chromium touch: a 110 px swipe up from a row of a bottom-sheet menu (scrolls) scrolls the sheet, acts on nothing (3 of 3; the previous head of this branch scrolled 0 px)
physical iPhone 14, iOS 26.2 Safari: land on Edit, slide to Delete, lift (3 takes) Delete only, lift cancelled, 0 of 24 moves cancelled Delete only, lift cancelled, 24 of 24 moves cancelled (no regression)
Android 14 emulator, Chromium 160, real finger: Edit→Delete slide, normal/slow/no motion (9 takes) 0 of 11 moves cancelled; lift cancelable and cancelled; Delete only 11 of 11 moves cancelled; lift cancelable and cancelled; Delete only
  • Owner preview check: passed on a phone at 620cf84 (2026-11-19 21:06 PT). The head since is a main merge (9caa7e3) that changes none of this PR's gesture files.
  • Device passes at this head (9caa7e3), side by side with 620cf84, identical:
    • Physical iPhone 14, iOS 26.2 Safari, real finger, 9caa7e3. Edit→Delete slide (6 takes): Delete runs once, the lift is cancelable and cancelled, 24–25 of 24–25 moves cancelled, the menu closes; Reduce Motion not recorded for this unit, and the farm never changes it. Bottom-sheet menu in landscape (844×390), one finger about 110 pt up from "Share project" (6 takes): the sheet body scrolls 98 pt, the sheet stays open, nothing acts; Reduce Motion off.
    • Android emulator (arm64), Chromium 160, 9caa7e3, animation scales 1 (window, transition, animator). Edit→Delete slide (3 takes): 11 of 11 moves cancelled, the lift is cancelable and cancelled, Delete only. Bottom-sheet menu at a 300 px viewport (3 takes): the sheet body scrolls 0 → 62.9 px, the sheet stays open, nothing is cancelled or clicked.
  • Device passes at the checked head (620cf84): Android emulator (Chromium 160): Edit→Delete cancels 11 of 11 moves (main 0 of 11), Delete only; a 110 px swipe in the bottom-sheet menu scrolls the sheet body with nothing selected, as on main. Real iPhone 14 (iOS 26.2): 24–25 of ~25 moves cancelled (main 0), Delete only; the sheet-menu swipe scrolls with nothing selected on both. Three takes each against main 472896d.
  • Earlier device passes: on a physical iPhone and an Android 14 emulator running Chromium 160 (a real finger), the change claims every move of a row-begun press and regresses nothing: both builds pick only the row the finger lifts on, with the lift cancelled. The uncancelable-lift symptom wasn't reproduced in the Android emulator (Chromium 160; spec:AST-094 DEC-27 evidence): main's lift stayed cancelable in that slide.
  • Unchanged paths: useMenuPress, DropdownMenu, ContextMenu, Selector and MoreMenu units pass 976/976. The menu press, pinch-zoom, shadow-root and touch focus-ring specs pass 26/26 (Chromium). DropdownMenu and ContextMenu interaction specs pass 27/27 (Chromium phone), as on main.
  • Not here: a BottomSheet that drags under a menu press inside it is a separate fix (the sheet yields to a touch-action that forbids its pan, spec:AST-094 FR18), in its own pull request.

Overlap checked: #12732, #12216, #12179, #11859 (vjeux's open menu-press drafts touch the same files but not this path: a preview build of the ContextMenu lift, a finger's touch outside the menu, a Home Screen app's late click, and the touchend node; none installs the touchmove preventer for a row-begun press)

Writing rubric results

  • R1–R7: the record change is one verification row; no claim text changes.

Owner and land path

  • Owner: Astryx maintainers, fix-loop lane 1.
  • Land path: code review, CI, merge.

useMenuPress installed its touchmove preventer only for a press that
opened the menu from its trigger. A finger that began on a row of an open
menu went straight to tracking and left its moves uncancelled, so Chrome
153 and later delivered its lift's touchend uncancelable and the lift's
native click could not be stopped. In a menu whose rows fit (touch-action
pinch-zoom, so the page does not pan there), such a press now installs
the same preventer, which comes off when the gesture ends; a menu that
scrolls keeps its moves for its own pan. A second finger still ends the
gesture and leaves pinch-zoom to the browser. Unit cases cover a fitting
and a scrolling menu and a mouse; a real-Chromium touch case checks every
move and the lift are cancelled and the row acts once (0 of 5 moves
cancelled on main).
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 20, 2026 5:24am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 19, 2026
@astracat-bot

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Nov 20, 2026, 12:02 PM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 8392147

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:spec-owner-review Current knowledge records await owner approval labels Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The row-begun claim fixes the cancelable lift in anchored menus, but it also stops bottom-sheet menus from scrolling under a finger.

  • useMenuPress.ts:1031 installs the touchmove preventer whenever the menu root itself does not overflow, so in a bottom-sheet menu (DropdownMenu or ContextMenu with presentation="bottom-sheet"), where the sheet's body scrolls, a swipe that begins on a row no longer scrolls the sheet and the lift selects the row under the finger, which breaks the rule that a drag starting in a scroll area stays with that area (in real Chromium a 110 px swipe up from "Share project" scrolls the sheet 81 px on main and selects "Edit project" on this branch).
  • The Android Chrome claim in the description needs the Android-emulator result stated in the description (emulator, browser, head, animation scale and result), or a narrower claim that matches what the Chromium tests prove.

One fix is to claim the moves only when nothing under the finger can pan, for example when the menu root's computed touch-action is pinch-zoom, and to add a test with a list inside a scrolling ancestor. The anchored-menu fix itself works: in real Chromium every move and the lift are now cancelled, and Delete still acts once.

Claims and files checked

Review mode: same-head; reason: none

  • Claim (changeset): a finger that starts on a row of a menu whose rows fit claims its moves, so Chrome keeps the lift cancelable and its native click no longer reaches the page. Verified for anchored menus: the new unit case fails on main and passes here, and in Chromium 5 of 5 moves and the lift are cancelled with one activation.
  • Claim: on Android Chrome 153 and later the menu acts on the row and the lift's native click no longer reaches the page. Partly verified in desktop Chromium (lift cancelled, one activation); no Android result is stated.
  • Claim: builders on the hook need no workaround for a row-begun press. Verified (the change is inside the hook).
  • Claim: everyone else is unchanged and a menu that scrolls keeps its native pan. False for bottom-sheet menus (finding above); a second finger still ends the gesture (useMenuPress.ts:875-888) and a mouse press is untouched (the 'mouse' gate and its unit case): verified.
  • Claim: the cause is that only a trigger-opened press installed the preventer. Verified (useMenuPress.ts:1094).
  • Claim: the change list (hook, three unit cases, one Chromium case, one verification row, patch changeset). Verified.
  • Claim: the unit case fails on main and passes here, and real Chromium goes from 0 of 5 to 5 of 5 cancelled moves. Verified: the unit case fails on main and passes here, and a Chromium touch run shows the same counts.
  • Claim: the unchanged-path suite totals. Not rerun; the hook and sheet-list suites pass here (83 of 83).
  • Claim: a sheet that drags under a menu press is a separate fix. Noted: that is the sheet's own drag, a different path from the sheet scroll in the finding above.
  • Claim: the overlapping open drafts do not install the preventer for a row-begun press. Verified: one installs it only for a continued opening pointer, and the other three add no install.
  • Claim: the record change is one verification row with no claim text change. Verified.
  • File .changeset/menu-row-press-claims-finger.md: clear.
  • File docs/specs/components/DropdownMenu/modules/useMenuPress.spec.md: clear.
  • File packages/core/src/DropdownMenu/__tests__/MenuPress.a11y.chromium.spec.ts: clear.
  • File packages/core/src/hooks/useMenuPress.test.tsx: the scrolling-menu case injects getScroller, so no case covers a list inside a scrolling ancestor.
  • File packages/core/src/hooks/useMenuPress.ts: the blocking finding above, plus a non-blocking comment-style suggestion at lines 1027-1030.

Automated review (maintainer link)

Comment thread packages/core/src/hooks/useMenuPress.ts Resolved
Comment thread packages/core/src/hooks/useMenuPress.ts Resolved
…it can pan

The claim read only whether the menu root overflows. A list in a
bottom-sheet menu never does, because the sheet's body scrolls, so every
swipe that began on a sheet row lost its scroll and the lift selected the
row under the finger. The claim now reads the menu's own touch-action:
only a menu that leaves no one-finger pan to the browser (a menu whose
rows fit declares pinch-zoom) claims the moves. A scrolling menu
(pan-y pinch-zoom) and a list in a scrolling sheet (auto) keep their pan.
The unit cases set the menu's touch-action through a restored stub and
cover pinch-zoom, pan-y pinch-zoom and auto; a real-Chromium case swipes
110 px up from a row of the bottom-sheet menu story and checks the sheet
scrolls and nothing acts.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 620cf84

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this draft head yet, and it runs once the pull request is marked ready for review. A finger that begins on a row of a menu whose rows fit now has its moves and its lift cancelled, and the bottom-sheet scroll regression from the earlier revision is fixed: a swipe from a sheet row scrolls the sheet and acts on nothing.

Two optional follow-ups:

  • The new verification row in the useMenuPress record quotes the earlier name of the scrolling-menu unit case and leaves out the bottom-sheet case; quote the current name and add the sheet case.
  • The device rows in the description do not name the commit they ran at; naming it lets a later revision show the evidence still applies.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: a finger that starts on a row of an open menu whose rows fit now claims its moves, as a trigger-opened press does. Verified: the new unit case fails on main and passes here, and in Chromium 5 of 5 moves are cancelled (none on main).
  • Claim: its lift stays cancelable, so its native click cannot reach the page. Verified: in Chromium the lift's touchend is cancelled here and is not cancelable on main, and a cancelled touchend creates no click.
  • Claim: a product team saw an uncancelable lift on Android Chrome 153 and later. Context: the description says the emulator did not reproduce it; headless Chromium shows the uncancelable lift on main.
  • Claim: builders on the hook need no workaround for a row-begun press. Verified: the change is inside the hook.
  • Claim: menus that scroll and bottom-sheet menus keep their native pan, a second finger still ends the gesture, and a mouse press is untouched. Verified: unit cases for both pan values and for a mouse pass, a swipe from a sheet row scrolls the sheet 63 px on both sides and acts on nothing, and the pinch-zoom specs pass.
  • Claim: the cause is that only a trigger-opened press installed the preventer. Verified in the hook's trigger path.
  • Claim: the change reads the menu's own computed touch-action and removes the preventer when the gesture ends. Verified in the hook and its gesture-end paths.
  • Claim: three unit cases with a stub that afterEach restores, and two Chromium touch cases. Verified: all pass here.
  • Claim: one verification row and a patch changeset. Verified; the row quotes the earlier name of one test (note above).
  • Claim: the evidence table's unit and Chromium rows. Verified here (0 to 5 of 5 moves cancelled; the sheet scrolls and nothing acts).
  • Claim: the iPhone and Android emulator rows. Stated in the description as device and emulator evidence.
  • Claim: the unchanged-path suites pass. Verified: the hook and menu unit suites pass (2078 of 2078), the menu press, pinch-zoom, shadow-root and touch focus-ring specs pass (27 of 27 at this head; the description counts 26), and the DropdownMenu interaction specs pass in Chromium phone emulation (27 of 27).
  • Claim: a sheet that drags under a menu press is a separate fix. Noted: that is the sheet's own drag, a different path from the sheet scroll checked here.
  • Claim: the overlapping open drafts do not install the preventer for a row-begun press. Verified: one installs it only for a continued opening pointer, and the other three add no install.
  • Claim: the record change is one verification row with no claim text change. Verified.
  • File .changeset/menu-row-press-claims-finger.md: clear.
  • File docs/specs/components/DropdownMenu/modules/useMenuPress.spec.md: non-blocking note on the quoted test name.
  • File packages/core/src/DropdownMenu/__tests__/MenuPress.a11y.chromium.spec.ts: clear.
  • File packages/core/src/hooks/useMenuPress.test.tsx: clear.
  • File packages/core/src/hooks/useMenuPress.ts: clear.

Automated review (maintainer link)

| FR1, FR3, AR2 | `Selector.test.tsx` press model suite | finger release over another option, finger/mouse release outside, listbox marker | A listbox that takes focus, acts on the press option, or closes under a finger fails |
| FR4 (scroll) | `MenuPress.a11y.chromium.spec.ts` (real Chromium) | Chromium touch pan in an overflowing menu; touch-action by overflow; finger slide and its stray click | Not provable in jsdom; a pan that acts on a row, or a slide that acts on the press row, fails |
| FR4 (pinch) | `MenuPinchZoom.a11y.chromium.spec.ts` (real Chromium, phone emulation) | two-finger pinch over a menu whose rows fit, over one that scrolls, and over a picker listbox | Not provable in jsdom; a pinch that leaves the page at scale 1, or acts on a row, fails |
| FR4 (row-begun finger) | `useMenuPress.test.tsx` ("a finger that begins on a row of a menu whose rows fit …", "… a menu that scrolls keeps its moves …"); `MenuPress.a11y.chromium.spec.ts` (real Chromium touch) | a finger that begins on a row and slides to another, in a menu whose rows fit and in one that scrolls | A move of a row-begun finger left uncancelled in a menu whose rows fit, or a cancelled move in a menu that scrolls, fails |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this row quotes the unit case "… a menu that scrolls keeps its moves …", the earlier name. At this head the case is "a finger that begins on a row keeps its moves where the browser can pan: a menu that scrolls, or a list in a sheet that scrolls". Quote the current name, and add the list inside a sheet that scrolls to the setup column, since both test files now prove it.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 9caa7e3

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the fix holds on this revision and the iPhone and emulator takes now run on it too, but the Android emulator evidence covers only one of the profiles the touch-presentation spec asks for.

  • Miss: the Android emulator takes on this revision ran Chromium 160 at animation scale 1 only, while spec:AST-094 DEC-27 proves an Android Chrome claim in Chrome with Gboard at normal scale, with animations removed and under a slow-device profile, so run the Edit to Delete slide and the bottom-sheet swipe in those three profiles on this revision and state each take in the description (emulator, browser, revision, animation scale or profile, and result).

One optional fix: the new verification row in the useMenuPress record still quotes the earlier name of the scrolling-menu unit case and leaves out the bottom-sheet case. CI has not run on this draft revision.

Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0): none.
  • Claim (changeset and description): a finger that starts on a row of an open menu whose rows fit now claims its moves, as a trigger-opened press does. Verified: the new unit case fails against main and passes here, and the new Chromium case sees every move cancelled.
  • Claim: its lift stays cancelable, so its native click cannot reach the page. Verified: the Chromium case sees the lift's touchend cancelled and Delete act once.
  • Claim: a product team saw an uncancelable lift on Android Chrome 153 and later. Context: the description says the emulator did not reproduce it; headless Chromium shows the uncancelable lift on main.
  • Claim: builders on the hook need no workaround for a row-begun press. Verified: the change is inside the hook.
  • Claim: menus that scroll and bottom-sheet menus keep their native pan, a second finger still ends the gesture, and a mouse press is untouched. Verified: the unit cases for both pan values and for a mouse, the sheet-swipe Chromium case, the pinch-zoom specs, and the second-pointer cancel in the row handler.
  • Claim: the cause is that only a trigger-opened press installed the preventer. Verified: the trigger's open is the only call site on main.
  • Claim: the change reads the menu's own computed touch-action and removes the preventer when the gesture ends. Verified in the row handler and the gesture-end paths.
  • Claim: three unit cases with a stub that the after-each hook restores, and two Chromium touch cases. Verified: all pass here.
  • Claim: one verification row and a patch changeset. Verified; the row quotes an earlier test name (note above).
  • Claim: the evidence table's unit and Chromium rows. Verified here.
  • Claim: the owner's phone check passed at the earlier revision, and the merge since changes none of this pull request's files. True as stated; the takes on this revision supersede it.
  • Claim: iPhone 14 takes on this revision, side by side with the revision the owner passed. Stated with device, browser, revision, motion setting and result; accepted.
  • Claim: Android emulator takes on this revision, side by side. Stated for Chromium 160 at animation scale 1 only (finding above).
  • Claim: the earlier-revision device passes. Context only.
  • Claim: the unchanged-path suites pass. Verified with a broader run here: the hook and menu unit suites (2086 of 2086), the menu press, pinch-zoom, shadow-root and touch focus-ring specs (27 of 27; the description counts 26), and the DropdownMenu and ContextMenu interaction specs in Chromium phone emulation (27 of 27).
  • Claim: a sheet that drags under a menu press is a separate fix. Noted.
  • Claim: the overlapping open drafts do not install the preventer for a row-begun press. Verified: one installs it only for a continued opening pointer, and the other three add no install.
  • Claim: the record change is one verification row with no claim text change. Verified.
  • File .changeset/menu-row-press-claims-finger.md: clear; its Chrome claim is what the emulator finding is about.
  • File docs/specs/components/DropdownMenu/modules/useMenuPress.spec.md: non-blocking note on the quoted test name.
  • File packages/core/src/DropdownMenu/__tests__/MenuPress.a11y.chromium.spec.ts: clear.
  • File packages/core/src/hooks/useMenuPress.test.tsx: clear.
  • File packages/core/src/hooks/useMenuPress.ts: clear in code; its Android evidence is the finding above.

Automated review (maintainer link)

@cixzhang cixzhang added the lane:1 Astryx fix-loop lane 1 owns this label Nov 21, 2026

This branch was successfully deployed

1 active deployment
Preview — 9caa7e31 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. lane:1 Astryx fix-loop lane 1 owns this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant