Repository navigation
Conversation
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).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 8392147 |
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
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:1031installs thetouchmovepreventer whenever the menu root itself does not overflow, so in a bottom-sheet menu (DropdownMenu or ContextMenu withpresentation="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 onmainand 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
mainand 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
mainand passes here, and real Chromium goes from 0 of 5 to 5 of 5 cancelled moves. Verified: the unit case fails onmainand 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 injectsgetScroller, 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.
…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.
|
/approve-spec 620cf84 |
There was a problem hiding this comment.
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
useMenuPressrecord 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
mainand passes here, and in Chromium 5 of 5 moves are cancelled (none onmain). - Claim: its lift stays cancelable, so its native click cannot reach the page. Verified: in Chromium the lift's
touchendis cancelled here and is not cancelable onmain, and a cancelledtouchendcreates 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-actionand removes the preventer when the gesture ends. Verified in the hook and its gesture-end paths. - Claim: three unit cases with a stub that
afterEachrestores, 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.
| | 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 | |
There was a problem hiding this comment.
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.
|
/approve-spec 9caa7e3 |
There was a problem hiding this comment.
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-094DEC-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
mainand 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
touchendcancelled 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-actionand 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.
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
touchenduncancelable after uncancelled moves, so the page could not stop it.useMenuPress: no workaround is needed for a row-begun press.Cause
useMenuPressinstalled its documenttouchmovepreventer 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 underspec:AST-094FR19, whatever a given browser then does with the lift; the reported symptom is Chrome 153+ making the lift'stouchenduncancelable (touchend.cancelablefalse 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 computedtouch-actionleaves no one-finger pan (a menu whose rows fit declarespinch-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 (apinch-zoommenu cancels the moves until the lift;pan-y pinch-zoomandautomenus keep them; a mouse cancels none), with the menu'stouch-actionset through a stub thatafterEachrestores.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).[fix]patch.Authority
spec:AST-094FR19: a recognizer that claims a touch mid-gesture registers a blockingtouchmovelistener 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-094FR21: when a gesture takes a touch, itstouchendMUST be cancelled and no click reaches the page.module:DropdownMenu/useMenuPressFR4 (a scrolling menu keeps its pan; a second pointer ends the gesture) and FR5.Evidence
spec:AST-094DEC-27 evidence): main's lift stayed cancelable in that slide.touch-actionthat forbids its pan,spec:AST-094FR18), 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
Owner and land path