Repository navigation
fix(Layer): a layer opened by a right click stays open when that press is released - #10128
Conversation
…s is released A light-dismissible layer that shows from a contextmenu event captures that press's pointer, so its release lands on the layer and the browser's light dismiss leaves it open. A later press outside still dismisses it (spec:AST-003 FR11-FR13). Fixes #6947
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 97e2aaf |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| LayerProvider | 4.2 kB (0) · 20 B CSS (0) | — | ✓ · ✓ · ✗ |
| TopNavHeading | 74.9 kB (+520 B) · 11.1 kB CSS (0) | — | — · — · — |
| SideNavHeading | 75.5 kB (+495 B) · 11.3 kB CSS (0) | — | — · — · — |
115 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| ListItem | 69.9 kB (+490 B) · 11.4 kB CSS (0) | — | — · — · — |
| TextArea | 62.3 kB (+484 B) · 9.3 kB CSS (0) | — | — · — · — |
| Tokenizer | 91.3 kB (+473 B) · 18.8 kB CSS (0) | — | — · — · — |
| DateInput | 184.3 kB (+472 B) · 17.0 kB CSS (0) | — | — · — · — |
| ComplexSelector | 70.9 kB (+471 B) · 11.8 kB CSS (0) | — | — · — · — |
| DateTimeInput | 205.9 kB (+470 B) · 18.7 kB CSS (0) | — | — · — · — |
| RadioList | 56.2 kB (+469 B) · 7.3 kB CSS (0) | — | — · — · — |
| Slider | 107.2 kB (+469 B) · 8.8 kB CSS (0) | — | — · — · — |
| TopNavMenu | 74.5 kB (+468 B) · 11.2 kB CSS (0) | — | — · — · — |
| InputGroup | 56.5 kB (+467 B) · 7.8 kB CSS (0) | — | — · — · — |
| FieldLabel | 51.0 kB (+465 B) · 5.7 kB CSS (0) | — | — · — · — |
| SideNavItem | 70.4 kB (+465 B) · 11.1 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 60.7 kB (+464 B) · 10.2 kB CSS (0) | — | — · — · — |
| ChatToolCalls | 31.8 kB (+464 B) · 8.3 kB CSS (0) | — | — · — · — |
| Button | 60.2 kB (+463 B) · 10.0 kB CSS (0) | — | — · — · — |
| TabList | 43.8 kB (+463 B) · 6.5 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 60.7 kB (+462 B) · 10.0 kB CSS (0) | — | — · — · — |
| SegmentedControl | 93.9 kB (+461 B) · 6.9 kB CSS (0) | — | — · — · — |
| lab/TourStep | 95.3 kB (+460 B) · 590 B CSS (0) | — | — · — · — |
| Spinner | 24.5 kB (+459 B) · 6.2 kB CSS (0) | — | — · — · — |
| Field | 54.8 kB (+456 B) · 7.2 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 61.0 kB (+456 B) · 10.0 kB CSS (0) | — | — · — · — |
| Timer | 13.8 kB (+456 B) · 6.0 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 103.6 kB (+456 B) · 773 B CSS (0) | — | — · — · — |
| ChatSendButton | 60.6 kB (+455 B) · 10.0 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 31.5 kB (+455 B) · 7.5 kB CSS (0) | — | — · — · — |
| TableCell | 108.9 kB (+455 B) · 17.8 kB CSS (0) | — | — · — · — |
| IconButton | 60.2 kB (+454 B) · 10.0 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 148.7 kB (+454 B) · 1.9 kB CSS (0) | — | — · — · — |
| Carousel | 69.8 kB (+453 B) · 10.9 kB CSS (0) | — | — · — · — |
| ChatMessageList | 27.9 kB (+452 B) · 7.0 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 296.9 kB (+452 B) · 2.6 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 84.5 kB (+451 B) · 12.1 kB CSS (0) | — | — · — · — |
| MobileNavToggle | 60.5 kB (+451 B) · 10.0 kB CSS (0) | — | — · — · — |
| StatusDot | 31.2 kB (+450 B) · 5.3 kB CSS (0) | — | — · — · — |
| lab/DialogHeroHeader | 82.9 kB (+450 B) · 372 B CSS (0) | — | — · — · — |
| Timestamp | 32.7 kB (+449 B) · 10.3 kB CSS (0) | — | — · — · — |
| Typeahead | 79.6 kB (+449 B) · 12.4 kB CSS (0) | — | — · — · — |
| lab/CommentPin | 57.1 kB (+448 B) · 1.2 kB CSS (0) | — | — · — · — |
| AppShell | 90.8 kB (+447 B) · 13.5 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 108.4 kB (+445 B) · 17.6 kB CSS (0) | — | — · — · — |
| charts/ChartTooltip | 176.8 kB (+444 B) · 423 B CSS (0) | — | — · — · — |
| FileInput | 69.1 kB (+443 B) · 10.9 kB CSS (0) | — | — · — · — |
| Text | 11.6 kB (+443 B) · 5.4 kB CSS (0) | — | — · — · — |
| Toolbar | 43.7 kB (+443 B) · 8.1 kB CSS (0) | — | — · — · — |
| DropdownMenu | 96.8 kB (+442 B) · 17.6 kB CSS (0) | — | — · — · — |
| NumberInput | 71.7 kB (+442 B) · 11.4 kB CSS (0) | — | — · — · — |
| ChatComposer | 77.8 kB (+441 B) · 12.0 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 86.2 kB (+441 B) · 751 B CSS (0) | — | — · — · — |
| lab/LineClamp | 13.8 kB (+441 B) · 168 B CSS (0) | — | — · — · — |
| TopNavMegaMenu | 69.6 kB (+439 B) · 11.8 kB CSS (0) | — | — · — · — |
| Tooltip | 29.5 kB (+438 B) · 4.4 kB CSS (0) | — | — · — · — |
| ChatLayout | 80.9 kB (+437 B) · 10.5 kB CSS (0) | — | — · — · — |
| Toast | 98.1 kB (+437 B) · 10.3 kB CSS (0) | — | — · — · — |
| ContextMenu | 107.6 kB (+436 B) · 17.4 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 70.0 kB (+436 B) · 9.7 kB CSS (0) | — | — · — · — |
| MoreMenu | 97.1 kB (+436 B) · 17.6 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 275.9 kB (+436 B) · 2.3 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 86.6 kB (+435 B) · 2.1 kB CSS (0) | — | — · — · — |
| lab/ListInput | 101.7 kB (+435 B) · 1.6 kB CSS (0) | — | — · — · — |
| CheckboxList | 69.3 kB (+433 B) · 8.2 kB CSS (0) | — | — · — · — |
| InfoTip | 46.6 kB (+433 B) · 5.3 kB CSS (0) | — | — · — · — |
| charts/ChartLegend | 49.0 kB (+432 B) · 224 B CSS (0) | — | — · — · — |
| DialogHeader | 63.0 kB (+432 B) · 11.5 kB CSS (0) | — | — · — · — |
| Heading | 12.2 kB (+432 B) · 5.4 kB CSS (0) | — | — · — · — |
| Popover | 89.0 kB (+432 B) · 14.2 kB CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 104.7 kB (+432 B) · 1.1 kB CSS (0) | — | — · — · — |
| Banner | 62.2 kB (+430 B) · 10.5 kB CSS (0) | — | — · — · — |
| Switch | 101.7 kB (+430 B) · 9.9 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 70.4 kB (+430 B) · 13.2 kB CSS (0) | — | — · — · — |
| HoverCard | 27.5 kB (+429 B) · 4.4 kB CSS (0) | — | — · — · — |
| TimeInput | 159.8 kB (+429 B) · 16.0 kB CSS (0) | — | — · — · — |
| TabMenu | 71.7 kB (+427 B) · 11.1 kB CSS (0) | — | — · — · — |
| CodeBlock | 74.9 kB (+426 B) · 11.3 kB CSS (0) | — | — · — · — |
| Lightbox | 120.4 kB (+426 B) · 10.6 kB CSS (0) | — | — · — · — |
| CheckboxListItem | 70.9 kB (+425 B) · 11.4 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 75.5 kB (+424 B) · 11.3 kB CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 75.5 kB (+424 B) · 11.3 kB CSS (0) | — | — · — · — |
| DrawerHeader | 63.2 kB (+423 B) · 12.9 kB CSS (0) | — | — · — · — |
| Stepper | 61.8 kB (+423 B) · 10.1 kB CSS (0) | — | — · — · — |
| AvatarGroupOverflow | 48.8 kB (+420 B) · 5.6 kB CSS (0) | — | — · — · — |
| Link | 53.0 kB (+417 B) · 7.0 kB CSS (0) | — | — · — · — |
| Calendar | 71.2 kB (+416 B) · 10.6 kB CSS (0) | — | — · — · — |
| DateRangeInput | 92.3 kB (+415 B) · 12.5 kB CSS (0) | — | — · — · — |
| Pagination | 109.5 kB (+414 B) · 17.8 kB CSS (0) | — | — · — · — |
| Selector | 99.4 kB (+414 B) · 17.4 kB CSS (0) | — | — · — · — |
| charts/Chart | 199.4 kB (+413 B) · 494 B CSS (0) | — | — · — · — |
| Table | 117.8 kB (+413 B) · 18.2 kB CSS (0) | — | — · — · — |
| lab/Schedule | 105.7 kB (+413 B) · 3.9 kB CSS (0) | — | — · — · — |
| lab/Comments | 341.3 kB (+412 B) · 2.5 kB CSS (0) | — | — · — · — |
| SideNav | 112.1 kB (+411 B) · 11.4 kB CSS (0) | — | — · — · — |
| lab/SelectableCardGroup | 64.3 kB (+411 B) · 162 B CSS (0) | — | — · — · — |
| lab/TransferListSelector | 114.3 kB (+411 B) · 1.9 kB CSS (0) | — | — · — · — |
| RadioListItem | 67.2 kB (+410 B) · 10.1 kB CSS (0) | — | — · — · — |
| Avatar | 43.1 kB (+409 B) · 5.5 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 71.0 kB (+408 B) · 10.9 kB CSS (0) | — | — · — · — |
| AvatarGroup | 45.9 kB (+407 B) · 5.7 kB CSS (0) | — | — · — · — |
| TextInput | 67.6 kB (+406 B) · 11.2 kB CSS (0) | — | — · — · — |
| Thumbnail | 64.5 kB (+404 B) · 11.6 kB CSS (0) | — | — · — · — |
| CommandPalette | 73.1 kB (+401 B) · 12.7 kB CSS (0) | — | — · — · — |
| PowerSearch | 284.0 kB (+401 B) · 24.2 kB CSS (0) | — | — · — · — |
| TopNav | 72.2 kB (+401 B) · 10.9 kB CSS (0) | — | — · — · — |
| MultiSelector | 94.6 kB (+399 B) · 16.8 kB CSS (0) | — | — · — · — |
| MobileNav | 70.5 kB (+398 B) · 10.6 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 334.2 kB (+393 B) · 2.4 kB CSS (0) | — | — · — · — |
| CheckboxInput | 64.2 kB (+390 B) · 9.2 kB CSS (0) | — | — · — · — |
| Markdown | 180.9 kB (+390 B) · 20.5 kB CSS (0) | — | — · — · — |
| lab/TransferList | 107.7 kB (+389 B) · 1.7 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 277.2 kB (+380 B) · 454 B CSS (0) | — | — · — · — |
| AlertDialog | 105.3 kB (+374 B) · 14.6 kB CSS (0) | — | — · — · — |
| ToggleButton | 86.6 kB (+365 B) · 10.1 kB CSS (0) | — | — · — · — |
| NavHeadingMenu | 16.3 kB (+124 B) · 3.5 kB CSS (0) | — | — · — · — |
| ProgressBar | 11.7 kB (0) · 6.3 kB CSS (0) | — | — · — · — |
| layer | — | — | — · ✓ · — |
| Layer | — | — | ✓ · ✓ · — |
Package size: @astryxdesign/core 7.04 MB packed (+2.2 kB); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 29 rows, core 40 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.
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.
Changes requested. The fix works: in Chromium and WebKit, a light-dismiss layer or a DropdownMenu opened from a right click now stays open after the button comes up, and the next press outside closes it.
- The changeset (
.changeset/layer-contextmenu-release.md) and the description say a held finger is fixed too, but every test and repro uses a mouse right-button press, so either narrow the wording to a right click or add a touch reproduction that fails onmain.
Optional: rename LayerContextMenuPress.a11y.chromium.spec.ts to .a11y.browser.spec.ts so the WebKit project runs it too. You could also shorten the @output line in the gestureCounter.ts header, which repeats the new function's doc comment.
[Automated review]
… too The changeset, story and claimContextMenuPress comment name the right click that the tests cover. The real-engine spec is a browser spec, so the WebKit project runs it as well.
There was a problem hiding this comment.
The fix works: in Chromium and WebKit, a light-dismiss layer or a DropdownMenu opened from a right click now stays open after the button comes up, and the next press outside closes it. The changeset now names only the right click that the tests cover.
Approval waits on one owner decision. This changes what a mouse right click does for every desktop user, so it passes as a defect fix against spec:AST-003 FR11–FR13 only with an engineering owner's ruling for the current head, and the only /approve-spec on this pull request names the previous commit. An engineering owner (the author counts) can record that ruling by commenting /approve-spec followed by the current head's full SHA.
[Automated review]
|
/approve-spec 229ae3c |
There was a problem hiding this comment.
Changes requested. The fix works: in Chromium and WebKit, a light-dismiss layer or a DropdownMenu opened from a right click now stays open after the button comes up, and the next press outside closes it. The spec change is approved for this head; two implementation points remain.
- Miss:
gestureCounter.ts:55-58addsdocumentlisteners forpointerup,pointercancelandcontextmenu(and rewirespointerdown) instead of subscribing through Core's shared input ownersubscribeInputinutils/inputStream.ts, whicharchitecture:react-component-runtimeINV16 and thepnpm review:preshared-owners check require. - Miss: desktop behavior change needs an owner decision: while the right button that opened a light-dismiss layer is still held, the pointer capture at
gestureCounter.ts:93stops hover and focus from following the mouse over the layer (in DropdownMenu, Duplicate no longer highlights or takes focus until the button comes up and the mouse moves again), so keep hover working during that press, for example by holding the capture only while the pointer is outside the layer, or cite an owner decision that covers it.
[Automated review]
…ners join the input stream Over the layer the capture lets go, so a held right press still highlights a menu's rows; outside it the capture holds, so the release there cannot dismiss the layer. The press and context-menu listeners subscribe through the shared input stream.
A claim lasts until its press is released, so each case releases the press it made and no claim reaches the next case.
|
/approve-spec 0d4a106 |
There was a problem hiding this comment.
Changes requested. The fix works: in Chromium and WebKit, a light-dismiss layer or a DropdownMenu opened from a right click now stays open after the button comes up, the next press outside closes it, and in the light DOM hover keeps working over the menu while the button is held. The spec change is approved for this head, and the gesture counter now listens through the shared input stream.
- Inside an open shadow root,
claimContextMenuPress(gestureCounter.ts:117-121) asksdocument.elementFromPoint, which answers with the shadow host, so the capture never lets go over the layer and, while the opening right button is held, DropdownMenu rows neither highlight nor take focus (Chromium and WebKit); hit-test in the layer's own root asuseMenuPress.tsdoes, and add a shadow-root case to the unit test.
Optional: the new AST-003 verification row could name WebKit beside Chromium, since the browser spec runs in both.
[Automated review]
In an open shadow root the document's hit test answers with the shadow host, so the capture held over the layer and its rows stopped highlighting. The test now runs in the layer's root, as the menu press does.
…ess itself The case moves to gestureCounter.test.ts, where the layer sits in an open shadow root and the root's own hit test answers with the layer.
|
/approve-spec b6bd39e |
There was a problem hiding this comment.
Approved pending CI: this is a draft, so CI has not run on this head yet, and marking it ready for review starts it.
The claim now hit-tests in the layer's own tree, so inside an open shadow root a DropdownMenu opened from a right click still highlights and focuses the row under the held mouse, and it stays open after the release in Chromium and WebKit. The new AST-003 verification row and the desktop fix carry an engineering owner's /approve-spec for this head.
[Automated review]
…release # Conflicts: # packages/core/src/Layer/useLayer.tsx
|
/approve-spec 856f1b6 |
There was a problem hiding this comment.
Changes requested. The fix works: in Chromium and WebKit, a layer or a DropdownMenu opened from a right click now stays open after the button comes up and closes on the next press outside, and the AST-003 verification row carries an engineering owner's approval for this head. Two things in claimContextMenuPress need a change first:
- Newly live check:
followPointercallselementFromPointon every move of the opening press (packages/core/src/Layer/gestureCounter.ts:124), a layout read on a pointer-move path that INV18 ofarchitecture:react-component-runtimerules out, and reading the layer's box once when the claim starts, then comparingclientX/clientYwith it until a scroll or resize invalidates it, removes the per-move read. - Miss: when the layer closes while the right button is still down (Escape, say), the claim keeps capturing the pointer to the closed popover until the release, so the page under the mouse shows no hover, and ending the claim once the layer is no longer
:popover-openfixes it.
[Automated review]
…d ends when the layer closes The claim hit-tested on every move of the opening press, a layout read on a pointer-move path. It now reads the layer's box, and the box of each popover open inside it, once, and again only after a scroll, a resize or a toggle inside the layer; a move compares coordinates with those boxes. A layer that closes while the button is still down lets the pointer go, so the page under it hovers again.
|
/approve-spec 0cc9d16 |
There was a problem hiding this comment.
Changes requested. The fix works: in Chromium, a layer or a DropdownMenu opened from a right click now stays open after the button comes up, closes on the next press outside, and lets the pointer go when it closes during the press. The AST-003 verification row carries an engineering owner's approval for this head.
packages/core/src/Layer/gestureCounter.ts:167-168add raw windowscrollandresizelisteners; subscribe both throughsubscribeInputfrompackages/core/src/utils/inputStream.ts, as the same function already does for its pointer listeners, so a change to the shared input stream reaches them too.
Non-blocking: the comment at gestureCounter.ts:114-116 reads better as short active sentences, and the description still says the claim hit-tests in the layer's own tree.
[Automated review]
…shared input stream
|
/approve-spec 6ff4c88 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft.
The fix works: in Chromium and WebKit, a layer or a DropdownMenu opened from a right click now stays open after the button comes up, also when the release lands away from the zone, and closes on the next press outside. The claim's scroll and resize listeners now go through subscribeInput, which resolves the last requested change, and the new AST-003 verification row carries an engineering owner's approval for this head.
Non-blocking: the new AST-003 row's Verification cell names only Chromium, while the browser spec also runs in WebKit.
[Automated review]
…a press is down The press tracking added permanent window pointerup, pointercancel and contextmenu listeners, so the page kept a pointerup listener at rest. They are now subscribed when a press starts and dropped when it ends.
|
/approve-spec 61441ce |
There was a problem hiding this comment.
Approved pending CI: the heavy suites (build, test and docsite-test) are deferred on this push and have not run on this head yet; they run in the pre-merge run.
The fix holds at this head. In Chromium and WebKit, a light-dismiss layer or a DropdownMenu opened from a right click stays open after the button comes up, also when the release lands away from the zone, and closes on the next press outside. Moving onto a menu row while the button is still down still focuses it. The AST-003 verification row carries an engineering owner's approval for this head.
Non-blocking:
- The new comment above
startPress(packages/core/src/Layer/gestureCounter.ts:36-37) is one 28-word sentence with two points; two short sentences fit the comment style. - The new AST-003 row's Verification cell names only Chromium, while the browser spec also runs in WebKit.
[Automated review]
| // The page listens for a press's end and its context menu only while a press | ||
| // is down, so at rest it keeps no pointerup listener of its own. |
There was a problem hiding this comment.
Non-blocking: this is one 28-word sentence with two points (INV29 allows 25 words in a description, one topic per sentence). Shorter:
// Subscribe to the press's end and its context menu only while a press
// is down. At rest, the page keeps no pointerup listener.|
/approve-spec d8761e6 |
There was a problem hiding this comment.
Approved pending CI: the heavy suites (build, test and docsite-test) are deferred on this push and have not run on this head yet; they run before merge.
The fix holds after the merge of main: in Chromium and WebKit, a light-dismiss layer or a DropdownMenu opened from a right click stays open after the button comes up. In Chromium, the next press outside closes it, and moving onto a menu row while the button is still down still focuses it. The AST-003 verification row carries an engineering owner's approval for this head.
Non-blocking:
- The comment above
startPress(packages/core/src/Layer/gestureCounter.ts:36-37) is one 28-word sentence with two points; two short sentences fit the comment style. - The new AST-003 row's Verification cell names only Chromium, while the browser spec also runs in WebKit.
[Automated review]
Fixes #6947.
User impact
A person who right-clicks an element that opens a light-dismissible layer from its
contextmenuevent sees the layer flash and close as soon as they let go of the mouse button. The common case is a DropdownMenu opened throughisMenuOpenfrom a right click on a nearby element, as in the issue. With this fix the menu stays open after that release and closes on the person's next press outside, as a context menu does.Problem and solution fit
popover="auto". The browser's light dismiss runs at eachpointerup, and a release outside every open popover reads as a dismissal. The press that opened the layer started before the layer existed, so its own release lands outside it.spec:AST-003FR11–FR13 state that one physical gesture cannot do both, whatever the browser's event order.The fix gives that press to the layer. When a light-dismissible layer shows while a press that fired
contextmenuis still down, the layer captures that pointer while it is outside the layer, so a release there lands on the layer and light dismiss leaves it open. Over the layer the capture lets go, so the held pointer still highlights a menu's rows, and a release there is inside the layer anyway. The claim ends at that press's release. CallingpreventDefaulton thepointerupdoes not stop Chromium's light dismiss (checked in real Chromium), so pointer capture is the lever. The tests use a mouse right click. The same path applies to any press that is still down when it firescontextmenu(Android Chrome's long press is one); iOS Safari fires nocontextmenufrom a long press.Expected behavior and authority
spec:AST-003FR11–FR13: pointer dismissal goes by gesture identity, and the gesture that opens a layer does not also close it. This PR adds one AST-003 verification row for FR11–FR13 that names the context-menu press case (Specs & Decisions asked for this row).Smallest restoration
Layer/gestureCounter.tsalready counts gestures for FR11–FR13. It now also records the pointer of the press in flight and whether that press firedcontextmenu, through the shared input stream (subscribeInput). A newclaimContextMenuPress(layer)captures that pointer to the layer while it is outside the layer, until the press's release or until the layer closes. A move reads no layout: the claim reads the layer's box, and the box of each popover open in it, once, and again only after a scroll, a resize or a toggle in the layer (scroll and resize come through the shared input stream). A layer inside an open shadow root works too.Layer/useLayer.tsx:show()makes that one call for a light-dismissible layer, right after the browser accepts the show.outsidePress.ts, and nothing for a primary-button press. DropdownMenu's own trigger press keeps its invoker hold.Interaction with the entrance input hold in the Popover stack (#8223): that hold ignores new taps while a touch entrance plays. This claim only affects the one press that opened the layer, and only its release target. Where a finger's long press fires
contextmenuand opens a Popover, that finger releases on the Popover instead of outside it. The hold has nothing to ignore there, because that release is not a new tap. A tap that comes later during the entrance is a new gesture, so the hold handles it as it does now. The two do not touch the same event, and theuseLayerchange is one call so that stack rebases simply.Evidence
--repeat-each=3). The layer and the DropdownMenu stay open after the release, also when the release lands 60 px away from the zone, and a later click outside closes both. With the right button still down, moving onto the DropdownMenu focuses the row under the pointer; with a capture that never lets go (the earlier head), that case fails.main's current copy (13 of 13), which is the copy CI runs from the merge ref. The 8 visual audit specs need a git checkout and were not run in that environment; CI runs them.useLayer.test.tsx: a layer shown from a context-menu press captures that press's pointer; over the layer the capture lets go, outside it takes the pointer again, another pointer's move changes nothing, and the release ends the claim.gestureCounter.test.ts: the claim lets go over the layer's box and holds outside it, reading the box once; it reads it again after a scroll; it works in an open shadow root; and a layer that closes while the button is down lets the pointer go and ends the claim. A keyboard context menu (Shift+F10, no press) and a layer without light dismiss capture nothing. The first test fails without theshow()call.Layer/__tests__/LayerContextMenuPress.a11y.browser.spec.ts(Chromium and WebKit projects): the real-engine cases above, on the newCore/LayerContextMenuPressOpensALayer story.Scope
Testing
vitest run packages/core/src/Layer packages/core/src/DropdownMenu packages/core/src/Popover packages/core/src/ContextMenu packages/core/src/Tooltipplaywright test --project=chromium packages/core/src/Layer/__tests__/LayerContextMenuPress.a11y.browser.spec.tsagainst a Storybook built from this head (right-button press and release, on and off the zone; a later click outside).Writing rubric results
R1 narration: none; the new verification row states the check and its failure in the present tense.
R2 research: none in the record; the Chromium
preventDefaultcheck lives in this description.R3 evidence: the row names the unit and real-Chromium checks that verify it.
R4 rejected alternatives: none in the record.
R5 change references: none.
R6 open questions: none.
Stack: #10128 → #10689