Repository navigation
fix(DropdownMenu): the press that opens the menu does not close it - #10689
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 3f0d82e |
There was a problem hiding this comment.
Requesting changes. The fix keeps the menu open after a quick mouse release off the trigger, as the settle rule in the DropdownMenu record's FR8 describes. The new press claim has two side effects to fix first:
- A plain mouse click that opens the menu now delivers its
pointerupandclickto the menu's layer instead of the trigger, becauseclaimPresscaptures the pointer at once (DropdownMenu.tsx:1423), so caller handlers on the trigger, such asbutton.onClickCaptureor arenderTriggercontrol's own click handler, stop running for every mouse open. - After a show that waited for another popover operation, the press model has already ended the gesture (
useMenuPress.ts:583-585), so a press held past the settle time and released outside leaves the menu open, contrary to the changeset and the new useMenuPress text.
Two changes would fix both: keep the trigger as the release target while the pointer is still over it, and let the press model decide the release after a replayed show, or stop claiming that case.
[Automated review]
3f0d82e to
33ebe49
Compare
|
/approve-spec 33ebe49 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head, because it is a draft and targets the #10128 branch rather than main.
A quick mouse release off the DropdownMenu trigger, or under a trigger that moved, now leaves the menu open, as the settle rule in the DropdownMenu record's FR8 describes. Both earlier issues are fixed: a plain click delivers its pointerup and click to the trigger again, and after a show that waited, a settled release outside closes the menu.
Non-blocking suggestions:
- The new FR8 verification rows say a release "after a show that waited" leaves the menu open; the spec checks a release on the trigger, and the record's new current-state bullet says a release off the trigger closes it, so "a release on the trigger after a show that waited" would be exact.
- The
gestureCounter.tsheader still says "Internal to Layer", though DropdownMenu now imports it.
[Automated review]
| // The trigger press that asks the menu to open. The show holds the trigger | ||
| // as the invoker through that press; that hold is set below, once the | ||
| // popover exists. |
There was a problem hiding this comment.
Non-blocking (INV29): the first sentence restates the ref's name. Suggested: "The show holds the trigger as the invoker through this press. The hold is set below, once the popover exists."
|
Thanks. Both suggestions are staged and land with the rebase onto |
33ebe49 to
c874e4b
Compare
|
/approve-spec c874e4b |
c874e4b to
1846ff5
Compare
|
/approve-spec 1846ff5 |
|
Both suggestions are in 1846ff5. The FR8 row names a release on the trigger after a show that waited, and the |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head, because the pull request targets the #10128 branch rather than main.
A quick mouse release off the DropdownMenu trigger, or under a trigger that moved, now leaves the menu open, as the settle rule in the DropdownMenu record's FR8 describes. The new interaction spec fails its three open-menu cases without the fix and passes all seven with it, and a plain click still delivers its pointerup and click to the trigger. Both earlier wording suggestions are in.
Non-blocking, still open:
- The comment above
openingPressRefinDropdownMenu.tsxopens by restating the ref's name; "The show holds the trigger as the invoker through this press. The hold is set below, once the popover exists." keeps only the reason.
[Automated review]
A mouse press on the trigger opens the menu, a `popover="auto"`. The browser's light dismiss reads a release outside the popover as a dismissal, also the release of that same press. The trigger stays the popover's invoker through the press, so a release on the trigger is safe. A quick release away from the trigger, or after the trigger moved away under the pointer, closed the menu at once, though the press model keeps it open before the settle time. A show that waited for another popover operation got no invoker hold at all. The layer runtime's press claim from the context-menu fix is now claimPress, for any press in flight, with claimContextMenuPress as its right-click gate. A release target, here the trigger, holds the pointer while the pointer is over it, so its own pointerup and click still reach it. When the show is accepted and the trigger press that asked for it is still down, the trigger becomes the invoker. A mouse press whose show is accepted at once is also claimed. After a show that waited, the press model no longer tracks the press, so only the invoker hold applies.
1846ff5 to
094f28e
Compare
|
/approve-spec 094f28e |
There was a problem hiding this comment.
Approved pending CI: one unit-test shard (test-ui (4/4)) is still running on this head; every other check has passed or been skipped.
A quick mouse release off the DropdownMenu trigger, or under a trigger that moved, now leaves the menu open, as the settle rule in the DropdownMenu record's FR8 describes. The new interaction spec fails its three open-menu cases without the fix and passes all seven with it in Chromium and WebKit, and a plain click still delivers its pointerup and click to the trigger.
Non-blocking:
- The comment above
openingPressRefinDropdownMenu.tsxstill opens by restating the ref's name (the earlier thread on that line). - Miss: the layout comment on the claim in
gestureCounter.tsnames the layer's boxes but not the trigger box thatisOverTargetalso reads; a short addition there names its reason.
[Automated review]
| // A move of the pointer reads no layout. The claim reads the layer's box, | ||
| // and the box of each popover open in it (a sub-menu), once. It reads them | ||
| // again only after a scroll, a resize or a toggle in the layer. |
There was a problem hiding this comment.
Non-blocking (INV18): isOverTarget below also reads the release target's box on the first move and after each scroll, resize or toggle. Suggested: "The claim reads the layer's box, the box of each popover open in it (a sub-menu), and the release target's box, once. It reads them again only after a scroll, a resize or a toggle in the layer."
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| LayerProvider | 4.2 kB (0) · 20 B CSS (0) | — | ✓ · ✓ · ✗ |
| lab/Comments | 347.0 kB (+318 B) · 2.5 kB CSS (0) | — | — · — · — |
| MoreMenu | 97.4 kB (+256 B) · 17.6 kB CSS (0) | — | — · — · — |
122 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DropdownMenu | 97.1 kB (+244 B) · 17.6 kB CSS (0) | — | ✓ · ✓ · ✓ |
| lab/CommentThread | 340.2 kB (+219 B) · 2.4 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 69.8 kB (+214 B) · 11.8 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 86.9 kB (+195 B) · 2.1 kB CSS (0) | — | — · — · — |
| TimeInput | 160.5 kB (+194 B) · 16.0 kB CSS (0) | — | — · — · — |
| MobileNavToggle | 60.7 kB (+192 B) · 10.0 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 60.9 kB (+189 B) · 10.0 kB CSS (0) | — | — · — · — |
| ChatSendButton | 60.8 kB (+189 B) · 10.0 kB CSS (0) | — | — · — · — |
| IconButton | 60.4 kB (+189 B) · 10.0 kB CSS (0) | — | — · — · — |
| DrawerHeader | 63.4 kB (+188 B) · 12.9 kB CSS (0) | — | — · — · — |
| CheckboxList | 67.8 kB (+187 B) · 7.7 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 61.2 kB (+187 B) · 10.0 kB CSS (0) | — | — · — · — |
| TextInput | 67.8 kB (+185 B) · 11.2 kB CSS (0) | — | — · — · — |
| Button | 60.4 kB (+184 B) · 10.0 kB CSS (0) | — | — · — · — |
| CommandPalette | 73.2 kB (+183 B) · 12.7 kB CSS (0) | — | — · — · — |
| lab/SelectableCardGroup | 64.5 kB (+183 B) · 162 B CSS (0) | — | — · — · — |
| Calendar | 71.4 kB (+182 B) · 10.6 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 60.9 kB (+182 B) · 10.2 kB CSS (0) | — | — · — · — |
| Thumbnail | 64.7 kB (+182 B) · 11.6 kB CSS (0) | — | — · — · — |
| TopNav | 72.4 kB (+182 B) · 10.9 kB CSS (0) | — | — · — · — |
| DateTimeInput | 206.7 kB (+181 B) · 18.7 kB CSS (0) | — | — · — · — |
| ListItem | 70.1 kB (+181 B) · 11.4 kB CSS (0) | — | — · — · — |
| Banner | 62.4 kB (+180 B) · 10.5 kB CSS (0) | — | — · — · — |
| DialogHeader | 63.2 kB (+180 B) · 11.5 kB CSS (0) | — | — · — · — |
| TopNavMenu | 74.7 kB (+180 B) · 11.2 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 75.7 kB (+179 B) · 11.3 kB CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 75.7 kB (+179 B) · 11.3 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 70.6 kB (+178 B) · 13.2 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 277.4 kB (+178 B) · 454 B CSS (0) | — | — · — · — |
| ComplexSelector | 71.1 kB (+177 B) · 11.8 kB CSS (0) | — | — · — · — |
| lab/LineClamp | 13.9 kB (+176 B) · 168 B CSS (0) | — | — · — · — |
| DateInput | 185.0 kB (+175 B) · 17.0 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 70.2 kB (+175 B) · 9.7 kB CSS (0) | — | ✓ · ✓ · ✓ |
| lab/EmojiPicker | 86.5 kB (+175 B) · 751 B CSS (0) | — | — · — · — |
| SideNav | 112.7 kB (+174 B) · 11.4 kB CSS (0) | — | — · — · — |
| TableCell | 109.0 kB (+173 B) · 17.9 kB CSS (0) | — | — · — · — |
| CheckboxInput | 64.4 kB (+172 B) · 9.2 kB CSS (0) | — | — · — · — |
| SideNavItem | 70.6 kB (+172 B) · 11.1 kB CSS (0) | — | — · — · — |
| Pagination | 109.7 kB (+171 B) · 17.8 kB CSS (0) | — | — · — · — |
| Selector | 99.6 kB (+171 B) · 17.4 kB CSS (0) | — | — · — · — |
| SideNavHeading | 75.7 kB (+171 B) · 11.3 kB CSS (0) | — | — · — · — |
| Timestamp | 32.9 kB (+171 B) · 10.3 kB CSS (0) | — | — · — · — |
| TopNavHeading | 75.3 kB (+171 B) · 11.2 kB CSS (0) | — | — · — · — |
| PowerSearch | 284.8 kB (+170 B) · 24.1 kB CSS (0) | — | — · — · — |
| SegmentedControl | 94.6 kB (+170 B) · 6.9 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 108.6 kB (+170 B) · 17.7 kB CSS (0) | — | — · — · — |
| RadioListItem | 67.4 kB (+169 B) · 10.1 kB CSS (0) | — | — · — · — |
| AvatarGroup | 46.1 kB (+168 B) · 5.7 kB CSS (0) | — | — · — · — |
| DateRangeInput | 92.5 kB (+168 B) · 12.5 kB CSS (0) | — | — · — · — |
| MultiSelector | 94.8 kB (+168 B) · 16.8 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 149.4 kB (+168 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 114.6 kB (+168 B) · 1.9 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 276.1 kB (+168 B) · 2.3 kB CSS (0) | — | — · — · — |
| TabList | 43.9 kB (+167 B) · 6.5 kB CSS (0) | — | — · — · — |
| AppShell | 91.0 kB (+166 B) · 13.5 kB CSS (0) | — | — · — · — |
| ChatLayout | 81.5 kB (+166 B) · 10.5 kB CSS (0) | — | — · — · — |
| TabMenu | 71.9 kB (+165 B) · 11.1 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 297.1 kB (+165 B) · 2.6 kB CSS (0) | — | — · — · — |
| Avatar | 43.3 kB (+164 B) · 5.5 kB CSS (0) | — | — · — · — |
| ChatComposer | 78.0 kB (+164 B) · 12.0 kB CSS (0) | — | — · — · — |
| CheckboxListItem | 71.0 kB (+164 B) · 11.4 kB CSS (0) | — | — · — · — |
| FieldLabel | 51.2 kB (+164 B) · 5.7 kB CSS (0) | — | — · — · — |
| Heading | 12.4 kB (+164 B) · 5.4 kB CSS (0) | — | — · — · — |
| Spinner | 24.7 kB (+164 B) · 6.2 kB CSS (0) | — | — · — · — |
| Stepper | 62.0 kB (+164 B) · 10.1 kB CSS (0) | — | — · — · — |
| TextArea | 62.5 kB (+164 B) · 9.3 kB CSS (0) | — | — · — · — |
| CodeBlock | 75.2 kB (+163 B) · 11.3 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 31.7 kB (+163 B) · 7.5 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 71.2 kB (+162 B) · 10.9 kB CSS (0) | — | — · — · — |
| Popover | 89.6 kB (+162 B) · 14.2 kB CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 105.4 kB (+162 B) · 1.1 kB CSS (0) | — | — · — · — |
| AlertDialog | 105.5 kB (+161 B) · 14.6 kB CSS (0) | — | — · — · — |
| Switch | 102.4 kB (+161 B) · 9.9 kB CSS (0) | — | — · — · — |
| RadioList | 56.4 kB (+160 B) · 7.3 kB CSS (0) | — | — · — · — |
| MobileNav | 70.7 kB (+159 B) · 10.6 kB CSS (0) | — | — · — · — |
| Text | 11.8 kB (+159 B) · 5.4 kB CSS (0) | — | — · — · — |
| lab/TransferList | 108.0 kB (+158 B) · 1.7 kB CSS (0) | — | — · — · — |
| ChatMessageList | 28.1 kB (+157 B) · 7.0 kB CSS (0) | — | — · — · — |
| InputGroup | 56.7 kB (+157 B) · 7.8 kB CSS (0) | — | — · — · — |
| Link | 53.2 kB (+157 B) · 7.0 kB CSS (0) | — | — · — · — |
| Toast | 98.2 kB (+157 B) · 10.3 kB CSS (0) | — | — · — · — |
| lab/DialogHeroHeader | 83.1 kB (+157 B) · 372 B CSS (0) | — | — · — · — |
| charts/ChartLegend | 49.3 kB (+156 B) · 224 B CSS (0) | — | — · — · — |
| Lightbox | 121.0 kB (+156 B) · 10.6 kB CSS (0) | — | — · — · — |
| Slider | 107.8 kB (+156 B) · 8.8 kB CSS (0) | — | — · — · — |
| Table | 123.3 kB (+156 B) · 18.3 kB CSS (0) | — | — · — · — |
| Timer | 14.0 kB (+156 B) · 6.0 kB CSS (0) | — | — · — · — |
| ChatToolCalls | 32.0 kB (+155 B) · 8.3 kB CSS (0) | — | — · — · — |
| Markdown | 185.9 kB (+155 B) · 20.6 kB CSS (0) | — | — · — · — |
| lab/CommentPin | 57.3 kB (+155 B) · 1.2 kB CSS (0) | — | — · — · — |
| lab/ListInput | 102.0 kB (+155 B) · 1.6 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 84.6 kB (+153 B) · 12.1 kB CSS (0) | — | — · — · — |
| lab/TourStep | 95.9 kB (+153 B) · 590 B CSS (0) | — | — · — · — |
| InfoTip | 46.8 kB (+152 B) · 5.3 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 104.3 kB (+151 B) · 773 B CSS (0) | — | — · — · — |
| AvatarGroupOverflow | 49.0 kB (+150 B) · 5.6 kB CSS (0) | — | — · — · — |
| ToggleButton | 86.8 kB (+148 B) · 10.1 kB CSS (0) | — | — · — · — |
| Tooltip | 29.6 kB (+147 B) · 4.4 kB CSS (0) | — | — · — · — |
| NumberInput | 71.8 kB (+146 B) · 11.4 kB CSS (0) | — | — · — · — |
| Field | 55.0 kB (+145 B) · 7.2 kB CSS (0) | — | — · — · — |
| HoverCard | 27.7 kB (+145 B) · 4.4 kB CSS (0) | — | — · — · — |
| Toolbar | 43.8 kB (+145 B) · 8.1 kB CSS (0) | — | — · — · — |
| Typeahead | 79.7 kB (+145 B) · 12.4 kB CSS (0) | — | — · — · — |
| lab/Schedule | 106.0 kB (+145 B) · 3.9 kB CSS (0) | — | — · — · — |
| ContextMenu | 107.8 kB (+143 B) · 17.4 kB CSS (0) | — | — · — · — |
| FileInput | 69.3 kB (+141 B) · 10.9 kB CSS (0) | — | — · — · — |
| Carousel | 69.9 kB (+140 B) · 10.9 kB CSS (0) | — | — · — · — |
| StatusDot | 31.4 kB (+138 B) · 5.3 kB CSS (0) | — | — · — · — |
| charts/Chart | 202.0 kB (+131 B) · 494 B CSS (0) | — | — · — · — |
| charts/ChartTooltip | 179.4 kB (+130 B) · 423 B CSS (0) | — | — · — · — |
| Tokenizer | 91.5 kB (+130 B) · 18.8 kB CSS (0) | — | — · — · — |
| NavHeadingMenu | 16.3 kB (+2 B) · 3.5 kB CSS (0) | — | — · — · — |
| ContextMenuItem | 29.2 kB (0) · 6.3 kB CSS (0) | — | — · — · — |
| DropdownMenuCheckboxItem | 22.7 kB (0) · 6.6 kB CSS (0) | — | ✓ · ✓ · ✓ |
| DropdownMenuDivider | 5.2 kB (0) · 548 B CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuGroup | 6.3 kB (0) · 3.4 kB CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuItem | 21.9 kB (0) · 6.3 kB CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuRadioGroup | 6.5 kB (0) · 3.3 kB CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuRadioItem | 22.7 kB (0) · 6.6 kB CSS (0) | — | ✓ · ✓ · — |
| ProgressBar | 11.7 kB (0) · 6.3 kB CSS (0) | — | — · — · — |
| layer | — | — | — · ✓ · — |
| Layer | — | — | ✓ · ✓ · — |
Package size: @astryxdesign/core 7.06 MB packed (+2.3 kB); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 29 rows, core 34 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
|
/approve-spec 094f28e |
User impact
A mouse press on a DropdownMenu trigger opens the menu. Released off the trigger, that press closes it at once: the pointer slipped, or the trigger moved.
Problem and solution fit
popover="auto", and light dismiss reads a release outside it as a dismissal. Only a release on the trigger, the invoker, is exempt.The fix keeps that press from dismissing the menu, as #10128 does for a right click.
Expected behavior and authority
component:DropdownMenuFR8 (current) verifies "the opening release before the settle time acts on nothing and the menu stays", in jsdom, without light dismiss. This restores shipped behavior to it.Smallest restoration
Layer/gestureCounter.ts: fix(Layer): a layer opened by a right click stays open when that press is released #10128's claim becomesclaimPress, for any press in flight.claimContextMenuPressis its right-click gate.DropdownMenu.tsx: while the opening press is down, the trigger is the invoker. A mouse press whose show is accepted at once is claimed. Outside both, its release lands on the layer.Evidence
main.gestureCounter.test.tsandDropdownMenu.test.tsx.Scope
Testing
At 744ccbe on
mainb4744d2. This head changes only one comment's line breaks:DropdownMenuOpeningRelease.interaction.browser.spec.ts, 3 runs: Chromium 21 of 21, WebKit 21 of 21.main). In Chromium and WebKit, the three open-menu cases fail on every run, and the other four pass.SliderFinePointer.interaction.browser.spec.ts, with its resting-listener case: 5 of 5 in each engine.LayerContextMenuPresspasses 4 of 4 in each engine.pnpm check:knowledgeandpnpm review:prepass.Writing rubric results
R1 narration: none; the records state the hold, the claim and the deferred-show gap in the present tense.
R2 research: none in the record.
R3 evidence: the verification rows name the browser spec that checks the claim.
R4 rejected alternatives: none in the record.
R5 change references: none.
R6 open questions: none.