Repository navigation
fix(DropdownMenu): a cancelled touch clears the row a finger lit - #8508
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DropdownMenuSubMenu | 72.8 kB (+211 B) · 9.7 kB CSS (0) | — | ✗ · ✓ · ✓ |
| DropdownMenu | 101.7 kB (+195 B) · 17.6 kB CSS (0) | — | ✗ · ✓ · ✓ |
| DropdownMenuCheckboxItem | 23.4 kB (0) · 6.6 kB CSS (0) | — | ✗ · ✓ · ✓ |
24 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DropdownMenuDivider | 5.3 kB (0) · 548 B CSS (0) | — | ✗ · ✓ · — |
| DropdownMenuGroup | 6.4 kB (0) · 3.4 kB CSS (0) | — | ✗ · ✓ · — |
| DropdownMenuItem | 22.6 kB (0) · 6.3 kB CSS (0) | — | ✗ · ✓ · — |
| DropdownMenuRadioGroup | 6.6 kB (0) · 3.3 kB CSS (0) | — | ✗ · ✓ · — |
| DropdownMenuRadioItem | 23.4 kB (0) · 6.6 kB CSS (0) | — | ✗ · ✓ · — |
| TabMenu | 76.6 kB (+290 B) · 11.2 kB CSS (0) | — | — · — · — |
| PowerSearch | 298.3 kB (+256 B) · 24.5 kB CSS (0) | — | — · — · — |
| TopNavHeading | 79.9 kB (+236 B) · 11.3 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 89.5 kB (+210 B) · 12.1 kB CSS (0) | — | — · — · — |
| Selector | 105.0 kB (+208 B) · 17.5 kB CSS (0) | — | — · — · — |
| Pagination | 115.2 kB (+203 B) · 17.8 kB CSS (0) | — | — · — · — |
| TopNavMenu | 79.3 kB (+196 B) · 11.3 kB CSS (0) | — | — · — · — |
| MoreMenu | 102.0 kB (+191 B) · 17.6 kB CSS (0) | — | — · — · — |
| SideNavHeading | 80.3 kB (+191 B) · 11.3 kB CSS (0) | — | — · — · — |
| ContextMenu | 112.8 kB (+189 B) · 17.5 kB CSS (0) | — | — · — · — |
| TableCell | 114.0 kB (+184 B) · 18.0 kB CSS (0) | — | — · — · — |
| Markdown | 193.1 kB (+183 B) · 20.8 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 113.6 kB (+183 B) · 17.7 kB CSS (0) | — | — · — · — |
| NavHeadingMenu | 18.1 kB (+178 B) · 3.5 kB CSS (0) | — | — · — · — |
| Table | 129.9 kB (+168 B) · 18.4 kB CSS (0) | — | — · — · — |
| ContextMenuItem | 32.9 kB (0) · 6.3 kB CSS (0) | — | — · — · — |
| lab/Comments | 358.4 kB (new) · 2.5 kB CSS (new) | — | — · — · — |
| lab/CommentThread | 351.6 kB (new) · 2.4 kB CSS (new) | — | — · — · — |
| richtext/RichTextEditorToolbar | 284.1 kB (new) · 454 B CSS (new) | — | — · — · — |
Visual changes: 4 snapshots in 1 component
A change is a question for the reviewer, not a failure.
Package size: measured; main has no measurement of the merge base to compare yet.
API changes: unknown (base surface unavailable): richtext, theme-butter, theme-chocolate, theme-gothic, theme-matcha, theme-neutral, theme-stone, theme-y2k
Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
The fix itself (clearing the row a finger lit when the browser cancels its press, in DropdownMenu and its flyouts) matches spec:AST-094 FR28, but this pull request can't be approved as submitted. Against main its diff is about 24,600 changed lines, because it carries the four open pull requests it is stacked on (#8076, #8298, #8446 and #8078). Please land those first and rebase so this pull request contains only its own commit. While you're there, a test showing that a second finger, and not only pointercancel, clears the lit row would cover the rest of FR28.
[Automated review]
|
At 36fd673:
|
There was a problem hiding this comment.
This pull request can't be approved as submitted. Its own fix (a cancelled finger clears the lit row in DropdownMenu and its flyouts) matches spec:AST-094 FR28 and its new tests, including the second-finger case, cover it, but against main the diff is still about 23,300 changed lines because it carries #8076, #8298, #8446 and #8078. Please land those in the stated order and rebase so this pull request contains only its own two commits. While you're there, a window-blur case and a cancel case in the real-Chromium menu test would cover the rest of FR28's verification.
[Automated review]
|
At 6ce4c57: the real-Chromium menu test adds FR28's other two cases, a cancelled touch and the window losing focus, each while a finger has a row lit. In both, the gesture ends with nothing acting, the row no longer lit, and the menu still open. Both fail on #8078's head, where the row stays lit. The blur case also showed a gap: the browser can keep the touch alive past the blur, and that touch's later lift ran the row through its click. A gesture the blur ended now swallows that click (module FR5), and a jsdom case pins it. Main's model has the same gap, and this closes it. |
meta#8078's module FR10 cases moved to the sub-menu pull request, so they leave this line too; the flyout's cancel case keeps this line's gesture-system finger. meta#8508's real-Chromium FR28 cases wait for this line's open animation to settle, as its own touch cases do; the blur case waits for the gesture host's fix.
There was a problem hiding this comment.
This pull request can't be approved as submitted. Its own fix, clearing the row a finger lit in DropdownMenu and its flyouts when the browser takes the touch, matches spec:AST-094 FR28, and the new cancel, second-finger and blur cases cover it, but against main the diff is still about 22,800 changed lines because it carries #8076, #8298, #8446 and #8078: please land those in the stated order and rebase so only this pull request's commits remain. The new blur commit also needs two changes:
- The listener
armStrayClickAtReleaseadds is removed only by that pointer's release, so when the page never sees a mouse press's release after a blur, the next mouse click anywhere is swallowed; dropping it at the nextpointerdownwould bound it. - The post-blur swallow also changes what a mouse does, so
spec:AST-017FR59 asks for a mouse case before and after, or the swallow can be kept to fingers.
[Automated review]
A menu shown as a bottom sheet still opens at the tap's click, so the release note names the anchored menu, as the press does. The hook's doc names a finger or a pen on every device, as the hook acts.
A raw page that scrolls with the document. Its Actions menu sits in a fixed top bar, so it opens as a finger presses it, and a slide onto a row runs that row once. Its More menu sits in the page, so a flick that starts on it scrolls the page. The bar shows which row ran and how many times.
Under a finger, on every device and every menu surface, a press that the browser takes (pointercancel, a second finger, a scroll) now clears the row the finger lit, as UIKit clears it when the list starts scrolling. That holds under any presentation, in sub-menus and in the bottom sheet's action list. When the window loses focus under a finger, its gesture is withdrawn: it stays tracked to its release, which acts on nothing and whose click is swallowed, and any new press ends it. A mouse keeps its highlight and its click. - menuPressGesture: the withdraw input and withdrawn phase, and the clear flag on a finger's cancel. - useMenuPress: both clears follow the machine's clear flag, which only a finger or pen sets. - MenuBottomSheetActionList: its list takes focus (tabIndex -1) when no row is lit, as DropdownMenu's own menu does, so a cleared row loses focus. - Tests: the machine, hook, sub-menu and sheet-list cases, and the accessibility case in real Chromium. A [fix] changeset.
5c349f0 to
abc8dbf
Compare
There was a problem hiding this comment.
Approved pending CI: every job was skipped on this draft head, so mark it ready for review and have a maintainer add the ci:run label so CI runs.
This review covers the stack #8078 → #8508, and a pull request lands only when it and every pull request below it are approved.
#8078: approved, no blocking findings.
#8508: approved, no blocking findings.
Whole stack: passes.
- Miss: optional (#8078).
menuPressValues.tsrepeatsDELAYS_CONTENT_TOUCHES_MS, whichmotion/uikit/scroll.tsalready exports, and the comment abovelongPressApiRefinuseMenuPress.tsstill says the detector is created in that file.
[Automated review]
There was a problem hiding this comment.
Changes requested. The fix itself, a cancelled finger or a window blur clearing the row a finger lit while the blurred finger's lift runs nothing and a mouse keeps its highlight and click, matches spec:AST-094 FR28 and FR44 and has passing cases for each path. The approved spec edit for this head does not change the blockers below, which all come from the Stack line no longer holding, so this pull request is reviewed on its own and its diff from main includes #8078.
- Regression: the Stack line no longer holds, because no listed pull request's head contains every other listed head (#9769's head is in no other entry, and neither #8080 nor this pull request contains the other's head), so #8078's open-on-press work (
menuTriggerPress.ts,menuScrollView.ts, the DropdownMenu record's FR8 edits, the sandbox page and two changesets) rides in this diff and has to come out. - Regression: the diff is 2,693 authored lines, of which this pull request's fix is 649, and no stack or behavior-module exemption applies while the Stack line does not hold.
- Regression: the
UseMenuPressOptions.longPressDelayMsdefault change (500to unset,useMenuPress.ts:154-160) is a public API row outside this pull request's scope (DropdownMenu, MoreMenu, ContextMenu, Selector), so it needs naming in the scope with an owner decision or leaving to #8078.
To clear all three, put back a Stack line that holds in every listed body (for example Stack: #8078 → #8508), or land #8078 first and merge main so the diff is the fix alone.
|
/approve-spec 8418e2a |
|
/approve-spec e5e1609 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because every job skipped on this draft from a fork. Mark the pull request ready for review, and a maintainer adds the ci:run label so CI runs.
A cancelled touch, a second finger or a window blur now clears the row a finger or pen lit, and a blurred finger's later lift runs nothing, as spec:AST-094 FR28 and FR44 require, while a mouse keeps its highlight and its click. The new cases fail on main and pass here, the real-Chromium touch-cancel and blur cases included, and with #8078 on main the diff is now the fix alone.
- Non-blocking: the comment at
menuPressGesture.ts:283-287can keep only its reasons; suggested wording is inline.
| // The withdrawn finger lifts: nothing acts, and the click the browser | ||
| // reports for it is still this gesture's, so it is swallowed. Its | ||
| // listeners come off as the gesture ends. A tap on the trigger keeps | ||
| // its click, which opens the menu: the pointer model's open, or a | ||
| // scroll view's open at the lift. |
There was a problem hiding this comment.
Non-blocking (INV29): this comment holds three topics, a passive "it is swallowed", and a sentence that restates the code ("Its listeners come off as the gesture ends"). Keeping only the reasons reads:
// The browser still sends a click for this lift. Swallow it.
// A tap on the trigger keeps its click, because that click opens the menu.











Behavior module: useMenuPress
One commit, merged with main at d9d7b10, which carries #8078.
User impact
On any device, a finger can light a row in an open DropdownMenu and then lose its press. The page scrolls, a second finger lands, or the window loses focus. The row stays lit and reads as a pending pick. iOS clears it, and nothing runs.
What led to it: the UIKit comparison behind
spec:AST-094FR28. A reviewer asked to split this fix out of #8078.Problem and solution fit
The press model ended a cancelled gesture without acting but kept its highlight. That is right for a mouse, whose highlight follows hover (
spec:AST-017FR59). A cancelled finger's lit row now clears on every device (spec:AST-094FR43). It clears in DropdownMenu under any presentation and its sub-menus, MoreMenu, ContextMenu, Selector's list and the sheet's action list. The nav menus' roots take no focus, so their rows keep a cancelled finger's highlight. A window blur withdraws the finger's gesture: the row clears, nothing runs, and its listeners end at its lift. A tap on the trigger that the blur interrupts keeps its click, so the menu still opens.Expected behavior and authority
spec:AST-094FR28 (current) says a cancelled touch, a second finger or the window losing focus ends the gesture. Nothing acts, and the lit row clears. No record changes.Smallest restoration
Evidence
presentation="popover"too, and a mouse keeps it lit.presentation="popover".Scope
Components: DropdownMenu, MoreMenu, ContextMenu, Selector.
Testing
On the DropdownMenu "Default" story, with touch emulation:
presentation="popover", press the trigger, switch windows, come back and lift: the menu opens.On an iPhone at e5e1609, DropdownMenu, ContextMenu and Selector match main side by side. That run can't drive the fix's own paths: a second finger, an app switch mid-touch, and a scroll while a row is held. They rest on the red-first tests: 12 of 445 fail on main without the fix.
Automated: the cancel, second-finger and blur cases fail on main at d9d7b10 without this change and pass here. So do the menu-press accessibility cases in Chromium. A
[fix]changeset records the change.The merge with main d9d7b10 applies this PR's own patch onto main: 10 files, +624/−19. A plain merge would bring back #8078's withdrawn split. The tree has no
hooks/menuTriggerPress.ts,hooks/menuScrollView.ts,useMenuSurfacePressoruseDropdownMenuPress.Local gates at e5e1609, on d9d7b10, pass. They are the ui project (24,429), the Node project (19,552), the core type check, strict ESLint and
pnpm review:pre. The DropdownMenu, motion, Layer, nav, Popover, ContextMenu and Selector interaction specs pass in Chromium: 318 pass, 16 skip. In WebKit's CI container at one worker, 239 pass and 95 skip. Their accessibility specs pass in Chromium (393), and the browser ones in WebKit (19).A first Node run at 40 workers timed out two tests this PR does not touch (
text-json-parity,active-release), under box load. Both pass alone here and on main.Review only this PR's change: vjeux/astryx@d9d7b10...e5e1609
Public and internal API delta
menuPressStepkeeps its released types.hooks/menuPressGesture.ts,MenuPressStategains a'withdrawn'phase,MenuPressInputawithdrawinput, andMenuPressOutcomeaclearflag and awithdrawoutcome.IDLE_MENU_PRESS's type widens to match.spec:AST-094FR28, FR44).menuPressTransition(gesture, {type: 'withdraw'}).effectis{type: 'withdraw', clear: true}while a row is lit.