Skip to content

fix(BottomSheet): a scrim press dismisses only when it starts and ends on the scrim (#11589) - #11611

Merged
cixzhang merged 10 commits into
meta:mainfrom
MuhammadAusafJamal:fix/bottom-sheet-scrim-press
Nov 22, 2026
Merged

cixzhang merged 10 commits into
meta:mainfrom
MuhammadAusafJamal:fix/bottom-sheet-scrim-press

Conversation

@MuhammadAusafJamal

@MuhammadAusafJamal MuhammadAusafJamal commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A BottomSheet with purpose="info" (default) or a BottomSheetSwitcher step closed when a pointer press started inside the sheet (such as selecting text in a field or dragging a slider thumb) and released on the scrim past the sheet's top edge. What the user was doing was lost. This restoration prevents unintended dismissal when a press crosses the sheet's edge, bringing sheet backdrop dismissal into consistency with Dialog and Drawer.

Problem and solution fit

  • Why does the defect occur? The native <dialog> element receives click events when event.target === event.currentTarget. When a press begins on a child element inside the sheet panel and releases over the backdrop outside, the browser routes the resulting click to their nearest common ancestor—the <dialog> itself.
  • Why does it harm the task? Dragging past the edge during standard mouse or pen operations (text selection, slider dragging, casual cursor movements) inadvertently triggers scrim click handlers.
  • Why does that harm matter? Any active user interaction, form input, or multi-step workflow within the sheet is abruptly dismissed and lost.
  • Fit: Adopting Layer/useBackdropPress ensures that dismissal occurs only when both pointer-down and pointer-up events land on the <dialog> backdrop directly. Pointer cancellation or crossing edges clears the press state without triggering close.

Expected behavior and authority

Smallest restoration

  • In packages/core/src/BottomSheet/BottomSheet.tsx, wired useBackdropPress to the standalone <dialog> root.
  • In packages/core/src/BottomSheet/BottomSheetSwitcher.tsx, wired useBackdropPress to the host dialog and forwarded pointer capture handlers via BottomSheetSwitcherContext to step <dialog> elements.
  • In docs/families/overlay-dismissal.md, updated FR10 to include BottomSheet (purpose="info") and BottomSheetSwitcher step scrims.
  • Updated tests in BottomSheet.test.tsx, BottomSheetSwitcher.test.tsx, and useBackdropPress.test.tsx.
  • Updated Storybook fixture BackdropPressA11y.stories.tsx and Playwright spec BackdropPress.a11y.chromium.spec.ts.
  • Added patch changeset .changeset/bottom-sheet-scrim-press-start-end.md.

Evidence

  • Reproduction before the change: In a BottomSheet with a TextInput, pressing inside the text field, dragging up, and releasing over the scrim dispatched click to <dialog>, dismissing the sheet (onOpenChange(false)).
  • Result after the change: The sheet remains open with the selection intact. A press that starts and ends on the scrim continues to dismiss as expected.
  • Representative unchanged path: Swipe-to-dismiss via finger gestures on BottomSheetPanel remains handled by touch gesture tracking and is unaffected. Bare clicks on the scrim still close the sheet.
  • Regression test or other mutation-sensitive proof:
    • packages/core/src/BottomSheet/BottomSheet.test.tsx: Edge crossing tests verify sheet stays open when press starts inside and ends on scrim, or starts on scrim and ends inside.
    • packages/core/src/BottomSheet/BottomSheetSwitcher.test.tsx: Switcher edge crossing tests verify step stays open when press crosses active dialog boundary.
    • packages/core/src/Layer/useBackdropPress.test.tsx: 71 matrix tests across all members (mouse, touch, cancelled pointers, nested layers, popovers).

Writing rubric results

  • R1 narration: None; present tense throughout.
  • R2 research in the record: None; research context kept out of record.
  • R3 evidence naming a change: Verified; matrix table links shared test files.
  • R4 rejected alternatives over one line or outside a decision: None.
  • R5 pull request or issue references remaining: None in record; tracked in PR description.
  • R6 ruled open questions still listing options: None.
  • R7 project status (build status or work order): None.

Scope

Components: BottomSheet, BottomSheetSwitcher, Layer

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm vitest run packages/core/src/BottomSheet/BottomSheet.test.tsx packages/core/src/BottomSheet/BottomSheetSwitcher.test.tsx packages/core/src/Layer/useBackdropPress.test.tsx (291/291 passed)
  • pnpm -F @astryxdesign/core typecheck (passed, 0 errors across 1,239 files)
  • pnpm check:knowledge (passed)
  • pnpm check:changesets (passed)
  • pnpm review:pre (0 findings)

Fixes #11589

Desktop before and after

Real Chrome at 1280 by 800 with a mouse, on the backdrop-press story (A11y / BackdropPress / Members). Before: main with this pull request's story. After: this head (8457e54).

With a mouse in Chromium at 1280 by 800, main closes a BottomSheet when a press that selects the text in its field is released over the scrim, and the selection is lost; this change keeps the sheet open with the text still selected. The same holds for a BottomSheetSwitcher step. With the sheet's Actions menu open, a scrim click on main closes the menu and the sheet together; with this change the first scrim click closes only the menu, and a second scrim click closes the sheet. The switcher step behaves the same way.

Case Sheet on main Sheet here Switcher step on main Switcher step here
Select the field's text with the mouse, release over the scrim Closes; the selection is lost Stays open; the selection (64 characters) stays Closes Stays open; the selection stays
Scrim click with the Actions menu open inside, first press Closes the menu and the sheet together Closes only the menu Closes the menu and the step together Closes only the menu
Second scrim click — (already closed) Closes the sheet — Closes the step
Frame Before (main) After (this head)
Sheet, selection released over the scrim Before After
Sheet, menu open Before After
Sheet, after the first scrim click Before After
Switcher step, selection released over the scrim Before After
Switcher step, after the first scrim click Before After

Maintainer carry

A maintainer commit on this branch (credited to the author) finishes the change:

  • Tests that pressed a sheet's scrim with a bare click now send the whole press (pointer down, pointer up, click): six more in BottomSheet, BottomSheetSwitcher and BottomSheetStacking, and Popover's bottom-sheet test for a scrim tap with hasLightDismiss={false}.
  • The source comments no longer cite a record, which the comment-provenance lint rejects.
  • The switcher reads the backdrop-press handlers one by one, so its memoized handlers list their real dependencies.
  • The header comment of Layer/useBackdropPress.ts stays as it was, so this pull request changes no runtime Layer module.
  • Checked: Popover's sheet still closes on a scrim tap with hasLightDismiss={false} (it uses purpose="info"), and the switcher still dismisses only from the active sheet's dialog. The affected suites pass (61 files, 2,287 tests), and type checking passes. A second carry commit sends the whole press in six more Core tests (DateTimeInput, MultiSelector, PowerSearch) and puts the Actions menu in the story's sheets for the browser checks.

A later maintainer merge brings in main with no conflict, and a last maintainer commit changes only comments and records: the switcher's scrim comment gives one reason a sentence, and family:overlay-dismissal's FR11 verification row and the Chromium spec's header name both sheets, which the menu-inside cases cover. No executable code changes in that commit.

A review suggestion that can wait for a later change is tracked in #13511.

Owner and land path

  • Owner: fix lane 2, an agent working for @cixzhang on Astryx maintenance, carrying this contribution.
  • Land path: draft until the automated review approves the exact head; then ready for review, CI, and merge.

…s on the scrim (meta#11589)

meta#11589. A BottomSheet with purpose="info" and a BottomSheetSwitcher step with its scrim closed on any click whose target was the <dialog>. A press that starts inside the sheet and ends on the scrim (such as a text selection or a slider drag released past the edge) also produces that click, because the browser sends it to the common ancestor, so the sheet closed and what the person was doing was lost.

Specs' ruling, one shared path: Layer/useBackdropPress records pointer-down and pointer-up on the dialog and dismisses on the click only when both landed on the backdrop; BottomSheet and BottomSheetSwitcher now adopt useBackdropPress, matching Dialog and Drawer. Record: family:overlay-dismissal FR10 states the rule and includes BottomSheet and BottomSheetSwitcher. Tests: useBackdropPress.test.tsx covers BottomSheet and BottomSheetSwitcher across mouse, touch, cancelled pointers, and nested layers; unit tests cover edge crossings; and BackdropPress.a11y.chromium.spec.ts includes both surfaces.
@vercel

vercel Bot commented Nov 13, 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 22, 2026 9:46am UTC

Request Review

@meta-cla

meta-cla Bot commented Nov 13, 2026

Copy link
Copy Markdown

Hi @MuhammadAusafJamal!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:spec-owner-review Current knowledge records await owner approval labels Nov 13, 2026
@astracat-bot

astracat-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 22, 2026, 10:02 AM UTC

@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.

Approval waits on an engineering owner's decision, and four blocking issues need changes.

This pull request extends the overlay-dismissal family's backdrop-press rule (FR10), which today names only Dialog, Drawer and CommandPalette, to BottomSheet with purpose="info" and to BottomSheetSwitcher steps; through AV4 it also makes a scrim press with a menu open inside a sheet close only the menu. An engineering owner approves or rejects that extension by commenting /approve-spec <full head SHA> on this pull request (the author may do so if they are an engineering owner).

Blocking:

  • Seven existing Core tests now fail because they click the sheet's <dialog> without pointerdown and pointerup (BottomSheetStacking.test.tsx:1023, DateTimeInputTouch.test.tsx:559, MultiSelector.test.tsx:238 and :263, PopoverPresentation.test.tsx:550, PowerSearchBottomSheet.test.tsx:3981 and :4050), so send both pointer events before each scrim click, as BottomSheet.test.tsx now does.
  • The Chromium spec's "with a menu open inside" loop (BackdropPress.a11y.chromium.spec.ts:146-152) now runs for BottomSheet and BottomSheetSwitcher, but the story's sheets render no Actions menu, so four tests time out unless both sheets in BackdropPressA11y.stories.tsx get the DropdownMenu or leave that loop.
  • The new family:overlay-dismissal and FR10 citations in the comments at BottomSheet.tsx:862 and BottomSheetSwitcher.tsx:1004 make the comment-provenance baseline check fail; please remove them.
  • Desktop behavior change needs an owner decision: for mouse and trackpad users, a press that starts in a sheet and ends on the scrim no longer closes it, and a scrim press with a menu open inside closes only the menu (BottomSheet.tsx:866-869, BottomSheetSwitcher.tsx:1008-1011).

If the extension is approved, FR11's text and verification row, the changeset, and the file headers of the story and the Chromium spec should also name the sheets.

Claims and files checked
  • Claim: sheets closed when a press started inside and was released on the scrim. Verified: in Chromium the base sheet closes on that mouse drag, and the new tests fail on the base.
  • Claim: the shared hook dismisses only when the press starts and ends on the backdrop, and a cancelled pointer clears it. Verified at useBackdropPress.ts:66-113 and by the new rows in useBackdropPress.test.tsx.
  • Claim: this brings sheets in line with Dialog and Drawer. Verified: the wiring matches Dialog.tsx:956-970 and Drawer.tsx:620-637.
  • Claim: FR10 now names the sheets. Verified at docs/families/overlay-dismissal.md:229-231 and :323; this is the change awaiting an owner.
  • Claim: the tests in three files are updated, and 287 of 287 pass. Verified at head (162 + 54 + 71).
  • Claim: the story and the Chromium spec are updated. Partly false: four of the new Chromium rows cannot pass.
  • Claim: a patch changeset is added. Verified.
  • Claim: after the change the sheet stays open, and a press on the scrim alone still closes it. Verified in Chromium with a mouse, and with a finger in the unit tests.
  • Claim: swipe-to-dismiss is unaffected. Verified: the swipe path is unchanged and the drag tests pass.
  • Claim: the shared hook's test file has 71 matrix tests. Verified.
  • Claim: typecheck, knowledge and changeset checks pass. Core's build typecheck and both checks pass at head; the repository-wide typecheck and the pre-review script were not run.
  • Claim: no new interaction model is hidden under the fix label. Partly false: a scrim press with a menu open inside a sheet now leaves the sheet open, and this is not stated.
  • Changeset: sheets close only on a press that starts and ends on the scrim. Verified.
  • Changeset: selecting text or dragging a control past the edge no longer closes the sheet. Verified with a mouse in Chromium.
  • Changeset: a press on the scrim alone still closes the sheet with a mouse, a pen or a finger. Verified for mouse and finger; pen uses the same pointer path.
  • .changeset/bottom-sheet-scrim-press-start-end.md: clear (narrower than the change).
  • apps/storybook/stories/BackdropPressA11y.stories.tsx: the sheets lack the Actions menu the spec expects, and the header is stale.
  • docs/families/overlay-dismissal.md: the FR10 edit awaits an owner, and FR11 is not updated.
  • packages/core/src/BottomSheet/BottomSheet.test.tsx: clear.
  • packages/core/src/BottomSheet/BottomSheet.tsx: the record citation at line 862 fails the provenance baseline.
  • packages/core/src/BottomSheet/BottomSheetSwitcher.test.tsx: clear.
  • packages/core/src/BottomSheet/BottomSheetSwitcher.tsx: the record citation at line 1004 fails the provenance baseline.
  • packages/core/src/BottomSheet/BottomSheetSwitcherContext.ts: clear.
  • packages/core/src/Layer/__tests__/BackdropPress.a11y.chromium.spec.ts: the menu loop now includes sheets with no menu, and the header is stale.
  • packages/core/src/Layer/useBackdropPress.test.tsx: clear.
  • packages/core/src/Layer/useBackdropPress.ts: clear.

Automated review (maintainer link)

@meta-cla

meta-cla Bot commented Nov 13, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 13, 2026
…ts and lint

Tests that pressed a sheet's scrim with a bare click now send the whole
press (pointer down, pointer up and click on the dialog), in BottomSheet,
BottomSheetSwitcher, BottomSheetStacking and Popover's sheet. The source
comments drop their record citations, and the switcher reads the backdrop
press handlers one by one so its memoized handlers list their real
dependencies. The useBackdropPress header comment is left as it was.

Co-authored-by: Muhammad Ausaf Jamal <[email protected]>
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 6f962e4

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 13, 2026
@cixzhang cixzhang added ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) labels Nov 13, 2026

@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.

Thanks for this fix. The spec question is settled: an engineering owner approved extending the backdrop-press rule (FR10) to BottomSheet with purpose="info" and BottomSheetSwitcher steps for this head. Three things still need changes before this can be approved:

  • Five existing Core tests that send a bare click (or a pointerdown with no pointerup) to a sheet's dialog now fail (DateTimeInputTouch.test.tsx:559, MultiSelector.test.tsx:238 and :263, PowerSearchBottomSheet.test.tsx:3981 and :4050), so send the whole press there, as your pressScrim helper does.
  • The new Chromium "with a menu open inside" tests for BottomSheet and BottomSheetSwitcher (BackdropPress.a11y.chromium.spec.ts:146-152) look for an Actions button that the story's sheets never render, so add <DropdownMenu button={{label: 'Actions'}} items={menuItems} /> to both sheets in BackdropPressA11y.stories.tsx, or leave the sheets out of that loop.
  • This changes what a mouse or trackpad does, so the description needs desktop before-and-after results: what main does and what this change does for a mouse press from the field released over the scrim, and for a scrim click while a menu is open inside the sheet.

Non-blocking: the changeset could say that a scrim press with a menu or popover open inside a sheet now closes only that layer, and "Bare clicks on the scrim still close the sheet" reads more accurately as "a press on the scrim alone still closes the sheet". The comment-provenance check passes now.

Claims and files checked
  • Claim: an info sheet and a switcher step close on a scrim press only when it starts and ends on the scrim — verified (BottomSheet.tsx:866-869, BottomSheetSwitcher.tsx:1008-1063, new unit tests; they fail against main).
  • Claim: a text selection or drag released past the sheet's edge no longer closes it — verified in Chromium (closes on main, stays open with the selection here).
  • Claim: a press on the scrim alone still closes it with a mouse, pen or finger — verified when nothing is open inside the sheet; with a menu open, the first press closes only the menu (non-blocking note).
  • Claim: on main the click of an edge-crossing press reaches the dialog and closes the sheet — verified (old handleClick; Chromium).
  • Claim: the shared hook needs pointer down and up on the dialog, and a cancelled pointer ends the press — verified (useBackdropPress.ts:66-91).
  • Claim: both hosts, the family record, the tests, the story, the Chromium spec and a patch changeset were updated — verified; four of the new Chromium tests cannot pass (above).
  • Claim: swipe-to-dismiss is unaffected — verified (the panel's onDismiss is unchanged and the BottomSheet suite passes).
  • Claim: bare clicks on the scrim still close the sheet — true for a real click; false for a click event with no press (above).
  • Claim: the three named test files pass (287 tests, 71 in the hook matrix) — verified.
  • Claim: Core type checking, the knowledge and changeset checks, and the pre-review report pass — verified.
  • Claim: no new public API, visuals or defaults — verified (API surface unchanged); the menu-inside interaction change is not described (non-blocking note).
  • Claim: the follow-up commit updates the remaining sheet tests, drops record citations from comments, lists real memo dependencies and leaves useBackdropPress.ts untouched — verified.
  • Files: BottomSheet.tsx, BottomSheetSwitcher.tsx, BottomSheetSwitcherContext.ts, BottomSheet.test.tsx, BottomSheetStacking.test.tsx, BottomSheetSwitcher.test.tsx, useBackdropPress.test.tsx, PopoverPresentation.test.tsx — clear.
  • Files: BackdropPress.a11y.chromium.spec.ts, BackdropPressA11y.stories.tsx — the Chromium menu tests above.
  • Files: docs/families/overlay-dismissal.md — approved; FR11's verification row could also name the sheets (non-blocking). .changeset/bottom-sheet-scrim-press-start-end.md — the non-blocking note above.

Automated review (maintainer link)

…tests; hold a menu in the story's sheets

DateTimeInput's touch sheet, MultiSelector's bottom sheet and PowerSearch's
sheet flow pressed the scrim with a bare click or with no pointer up; they now
send pointer down, pointer up and click on the dialog. The backdrop-press
story's BottomSheet and BottomSheetSwitcher step hold the same Actions menu
as Dialog and Drawer, so the Chromium menu-inside checks reach it. The
changeset says that a scrim press with a menu open inside closes only the
menu.

Co-authored-by: Muhammad Ausaf Jamal <[email protected]>
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 8457e54

@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.

Almost there: the Core tests, the story's Actions menu and the changeset are fixed, and an engineering owner approved the FR10 change for this head, so only the pull request description still needs a change.

  • This changes what a mouse or trackpad does, so the description needs desktop before-and-after results in its own words, for example: with a mouse in Chromium at 1024 × 768, main closes the sheet on a press from its field released over the scrim while this change keeps it open with the text selected, and with a menu open inside the sheet main closes the menu and the sheet on one scrim click while this change closes only the menu and the next click closes the sheet.

Non-blocking: FR11's verification row in docs/families/overlay-dismissal.md could also name the two sheets, and "Bare clicks on the scrim still close the sheet" reads more accurately as "a press on the scrim alone still closes the sheet". Editing the description is enough; no new commit is needed.

Claims and files checked
  • Changeset: an info sheet and a switcher step close on a scrim press only when it starts and ends on the scrim — verified (BottomSheet.tsx:866-869, BottomSheetSwitcher.tsx:1013-1016; the new unit tests fail against main and pass here).
  • Changeset: a text selection or drag released past the sheet's edge no longer closes it — verified in Chromium for a text selection (closes on main, stays open with the selection here); a slider drag takes the same path.
  • Changeset: a press on the scrim alone still closes it with a mouse, a pen or a finger — verified for mouse and finger in Chromium; pen uses the same pointer events.
  • Changeset: with a menu or popover open inside, a scrim press closes only that layer and the next closes the sheet — verified (Chromium menu tests, popover unit tests).
  • Description: on main, a press from inside released over the scrim closes the sheet because the click reaches the dialog — verified (old click handler; Chromium on main).
  • Description: the shared hook needs pointer down and up on the dialog, and a cancelled pointer ends the press — verified (useBackdropPress.ts:66-91).
  • Description: the same rule already covers Dialog, Drawer and CommandPalette — verified (the earlier fix is in history; the record's FR10).
  • Description: both hosts, the family record, the tests, the story, the Chromium spec and a patch changeset were updated — verified.
  • Description: after the change the sheet stays open with the selection, and a scrim-only press still closes it — verified in Chromium.
  • Description: swipe-to-dismiss is unaffected — verified (the panel's dismiss callback is unchanged and the BottomSheet suite passes).
  • Description: bare clicks on the scrim still close the sheet — true for a real click; false for a click event with no press (non-blocking wording).
  • Description: the edge-crossing regression tests and the backdrop-press matrix — verified (26 of them fail against main; all pass here).
  • Description: the three named test files pass (287 tests) — verified.
  • Description: Core type checking, the knowledge check and the changeset check pass — verified.
  • Description: the pre-review report has no findings — verified (0 findings, 404 authored lines).
  • Description: no new public API, visuals or defaults — verified (API surface unchanged); the menu-case interaction is now in the changeset.
  • Description: the maintainer commit updates six more sheet tests and the Popover sheet test, drops record citations from comments, lists real memo dependencies and leaves useBackdropPress.ts untouched — verified.
  • Description: Popover's sheet still closes on a scrim tap with hasLightDismiss={false}, and the switcher dismisses only from the active sheet's dialog — verified (both tests pass).
  • Description: desktop before-and-after results for mouse or trackpad — missing (above).
  • Files: BottomSheet.tsx, BottomSheetSwitcher.tsx, BottomSheetSwitcherContext.ts — clear.
  • Files: BottomSheet.test.tsx, BottomSheetStacking.test.tsx, BottomSheetSwitcher.test.tsx, useBackdropPress.test.tsx, DateTimeInputTouch.test.tsx, MultiSelector.test.tsx, PopoverPresentation.test.tsx, PowerSearchBottomSheet.test.tsx — clear (all sheet-related Core tests pass).
  • Files: BackdropPress.a11y.chromium.spec.ts, BackdropPressA11y.stories.tsx — clear (32 of 32 Chromium tests pass).
  • Files: .changeset/bottom-sheet-scrim-press-start-end.md — clear.
  • Files: docs/families/overlay-dismissal.md — approved; the FR11 row note above (non-blocking).

Automated review (maintainer link)

Comment thread docs/families/overlay-dismissal.md Resolved

@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 head yet. This pull request is still a draft, so CI starts when it is marked ready for review; it already carries the ci:run label a fork needs. An engineering owner approved the FR10 change for this exact head, the description now gives the desktop before-and-after results, and they match what the review measured.

Non-blocking:

  • FR11's verification row in docs/families/overlay-dismissal.md could also name the two sheets, since the unit and Chromium tests now cover them with a menu or popover open inside.
  • "Bare clicks on the scrim still close the sheet" reads more accurately as "a press on the scrim alone still closes the sheet", because a click event with no pointer down and up no longer closes it.
  • Miss: the changed comment above handleScrimPress in BottomSheetSwitcher.tsx packs three topics into a 27-word sentence; a suggested rewrite is on the line.
Claims and files checked
  • Changeset: an info sheet and a switcher step close on a scrim press only when it starts and ends on the scrim — verified (BottomSheet.tsx:863-869, BottomSheetSwitcher.tsx:1005-1016; the new unit tests fail against the base and pass here).
  • Changeset: a text selection or a drag released past the sheet's edge no longer closes it — verified in Chromium for a text selection (closes on the base, stays open with the selection here); a slider drag takes the same path.
  • Changeset: a press on the scrim alone still closes it with a mouse, a pen or a finger — verified for mouse and finger in Chromium; a pen goes through the same pointer events, and the hook does not read the pointer type.
  • Changeset: with a menu or popover open inside, a scrim press closes only that layer and the next closes the sheet — verified (Chromium menu tests, popover unit tests).
  • Description: on main, a press from inside released over the scrim closes the sheet because its click reaches the dialog — verified (the removed click handler; Chromium on the base code).
  • Description: the shared hook needs pointer down and up on the dialog, and a cancelled pointer ends the press — verified (useBackdropPress.ts:66-91).
  • Description: the same rule already covers Dialog, Drawer and CommandPalette (#9613) — verified (history and FR10).
  • Description: both hosts, the family record, the tests, the story, the Chromium spec and a patch changeset were updated — verified.
  • Description: after the change the sheet stays open with the selection, and a press on the scrim alone still closes it — verified in Chromium.
  • Description: swipe-to-dismiss is unaffected — verified (the panel's dismiss callback is unchanged and the BottomSheet suite passes).
  • Description: bare clicks on the scrim still close the sheet — true for a real click; a click event with no press no longer does (non-blocking wording above).
  • Description: the edge-crossing regression tests and the 71-test backdrop-press matrix — verified (71 tests; 26 of the new rows fail against the base).
  • Description: the three named test files pass (287 tests) — verified.
  • Description: Core type checking passes over 1,201 source files, and the knowledge and changeset checks pass — verified.
  • Description: the pre-review report has no findings — verified (0 findings, 404 authored lines).
  • Description: no new public API, visuals or defaults, and no internal context in public text — verified (public API surface unchanged).
  • Description: desktop before and after with a mouse at 1280 × 800 — on main a selection released over the scrim closes the sheet and the step and a scrim click with the menu open closes both; here they stay open with the selection, the first click closes only the menu and the second closes the host — verified (Chromium at 1280 × 800 on both trees; the story's note is 64 characters).
  • Description: the maintainer commit sends the whole press in six more sheet tests and Popover's sheet test, drops record citations from comments, lists real memo dependencies and leaves useBackdropPress.ts unchanged — verified.
  • Description: Popover's sheet still closes on a scrim tap with hasLightDismiss={false}, and the switcher dismisses only from the active sheet's dialog — verified (both tests pass).
  • Description: the affected suites pass — verified (80 sheet-related Core test files pass here; the description's 61-file selection was not reproduced exactly).
  • Description: a second carry commit sends the whole press in five more Core tests and adds the Actions menu to the story's sheets — verified (six tests changed; the sixth already passed).
  • Files: BottomSheet.tsx, BottomSheetSwitcher.tsx, BottomSheetSwitcherContext.ts — clear, apart from the comment wording note above.
  • Files: BottomSheet.test.tsx, BottomSheetStacking.test.tsx, BottomSheetSwitcher.test.tsx, useBackdropPress.test.tsx, DateTimeInputTouch.test.tsx, MultiSelector.test.tsx, PopoverPresentation.test.tsx, PowerSearchBottomSheet.test.tsx — clear (all pass).
  • Files: BackdropPress.a11y.chromium.spec.ts, BackdropPressA11y.stories.tsx — clear (all 32 Chromium tests pass).
  • Files: .changeset/bottom-sheet-scrim-press-start-end.md — clear.
  • Files: docs/families/overlay-dismissal.md — approved; the FR11 row note above (non-blocking).

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as draft November 21, 2026 08:43
@cixzhang
cixzhang marked this pull request as ready for review November 21, 2026 08:44
@cixzhang cixzhang added the lane:4 Astryx fix-loop lane 4 owns this label Nov 21, 2026
@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Nov 21, 2026
@cixzhang
cixzhang marked this pull request as draft November 22, 2026 07:04
@github-actions github-actions Bot added the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Nov 22, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 4d013c7

@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 commit yet, because its workflow runs are waiting for a maintainer to approve them (the ci:run label is already on).

Both sheet scrims now follow the shared backdrop-press rule, and an engineering owner approved the family:overlay-dismissal FR10 change for this commit. The new tests fail on the previous code and pass here, in unit tests and in Chromium.

Optional follow-up, not blocking, already tracked in #13511:

  • In BottomSheetSwitcher.tsx (lines 1073-1074), "The click handler still checks for the active dialog" restates the code and names one handler where all four check; "Each handler still checks for the active dialog" is enough.
Claims and files checked

Review mode: full; reason: merge-touches-pr-files

  • Changeset: an info sheet and a switcher step close on a scrim press only when the press starts and ends on the scrim. Verified (BottomSheet.tsx:878-884, :948-951; BottomSheetSwitcher.tsx:1076-1134); the new tests fail on the previous code and pass here.
  • Changeset: selecting text or dragging a control past the sheet's edge no longer closes it. Verified in Chromium for a text selection, which stays selected; a control drag ends on the same pointer-up check.
  • Changeset: a press on the scrim alone still closes the sheet with a mouse, a pen or a finger. Verified for a mouse click and a finger tap in Chromium; the shared hook does not read the pointer type, so a pen takes the same path.
  • Changeset: with a menu or popover open inside, a scrim press closes only that layer and the next one closes the sheet. Verified (the hook's popover rows; Chromium with the Actions menu open, focus left in the sheet).
  • Description: the cause (the click goes to the dialog as the nearest common ancestor) and the fix through the shared hook, with a cancelled pointer ending the press. Verified (useBackdropPress.ts:38-56, :87-91).
  • Description: FR10 as the expected behavior, with the earlier Dialog, Drawer and CommandPalette fix as precedent. Verified: the precedent fix is on main, and the FR10 edit is owner-approved for this commit.
  • Description: the smallest-restoration file list, the reproduction and the result after the change. Verified against the 15 changed files and in Chromium on this commit.
  • Description: swipe to dismiss is unchanged, and a plain scrim click still closes the sheet. Verified (the panel and its dismiss path are unchanged; swipe tests pass; Chromium scrim click closes). A synthetic click with no pointer events no longer closes, which is why seven test files now send the whole press.
  • Description: the regression tests, 71 hook matrix tests, and 291 of 291 in the three suites. Verified (71; 162 + 58 + 71 pass).
  • Description: Core type check, knowledge check, changeset check, and a pre-review report with no findings. Verified on this commit.
  • Description: one defect, no hidden public API, visual, default or interaction-model change, and no internal context in public text. Verified: the built API surfaces show no change, and the public text is clean.
  • Description: desktop mouse before and after for the sheet and the switcher step (a text selection released on the scrim; a scrim click with the menu open, then a second one). Verified by browser checks on this commit.
  • Description: the maintainer carry (whole-press tests, source comments without record citations, handlers read one by one, the hook file unchanged, Popover's sheet still closing on a scrim tap with hasLightDismiss={false}, the switcher dismissing only from the active step, the story's Actions menu, a last commit of comments and records only, and a clean merge of main). Verified; the affected suites pass on this commit.
  • Description: a review suggestion deferred to #13511, and the fix for #11589. Verified: #13511 tracks the comment wording above, and #11589 reports this defect.
  • Files: the changeset, the story, overlay-dismissal.md, BottomSheet.tsx, BottomSheetSwitcherContext.ts, the Chromium spec and the eight unit test files: clear. BottomSheetSwitcher.tsx: the non-blocking comment note above.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 22, 2026 07:46
@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Nov 22, 2026
@cixzhang
cixzhang marked this pull request as draft November 22, 2026 09:34
@github-actions github-actions Bot added the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Nov 22, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 9510918

@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 commit yet, because the pull request is still a draft and its workflow runs wait for a maintainer to approve them (the ci:run label is already on).

Both sheet scrims now follow the shared backdrop-press rule, and an engineering owner approved the family:overlay-dismissal FR10 change for this commit. The new tests fail on the previous code and pass here, in unit tests and in Chromium.

Optional follow-up, not blocking, already tracked in #13511:

  • In BottomSheetSwitcher.tsx (lines 1073-1074), "The click handler still checks for the active dialog" restates the code and names one handler where all four check; "Each handler still checks for the active dialog" is enough.
Claims and files checked

Review mode: full; reason: other:cited-record-changed-on-main

  • Changeset: an info sheet and a switcher step close on a scrim press only when the press starts and ends on the scrim. Verified (BottomSheet.tsx:876-884, :948-951; BottomSheetSwitcher.tsx:1071-1134); the new tests fail on the previous code and pass here.
  • Changeset: selecting text or dragging a control past the sheet's edge no longer closes it. Verified in Chromium for a text selection, which stays selected; a control drag ends on the same pointer-up check.
  • Changeset: a press on the scrim alone still closes the sheet with a mouse, a pen or a finger. Verified for a mouse click and a finger tap in Chromium; the shared hook does not read the pointer type, so a pen takes the same path.
  • Changeset: with a menu or popover open inside, a scrim press closes only that layer and the next one closes the sheet. Verified (the hook's popover rows; Chromium with the Actions menu open, focus left in the sheet).
  • Description: the cause (the click goes to the dialog as the nearest common ancestor) and the fix through the shared hook, with a cancelled pointer ending the press. Verified (useBackdropPress.ts:38-56, :87-91).
  • Description: FR10 as the expected behavior, with the earlier Dialog, Drawer and CommandPalette fix as precedent. Verified: Dialog and Drawer call the shared hook on main, and the FR10 edit is owner-approved for this commit.
  • Description: the smallest-restoration file list, the reproduction and the result after the change. Verified against the 15 changed files and in Chromium on this commit.
  • Description: swipe to dismiss is unchanged, and a plain scrim click still closes the sheet. Verified (the panel and its dismiss path are unchanged; swipe tests pass; a Chromium scrim click closes). A synthetic click with no pointer events no longer closes, which is why seven test files now send the whole press.
  • Description: the regression tests, 71 hook matrix tests, and 291 of 291 in the three suites. Verified (71; 162 + 58 + 71 pass).
  • Description: Core type check, knowledge check, changeset check, and a pre-review report with no findings. Verified on this commit.
  • Description: one defect, no hidden public API, visual, default or interaction-model change, and no internal context in public text. Verified: the built API surfaces show no change, and the public text is clean.
  • Description: desktop mouse before and after for the sheet and the switcher step (a text selection released on the scrim; a scrim click with the menu open, then a second one). Verified by browser checks on this commit.
  • Description: the maintainer carry (whole-press tests, source comments without record citations, handlers read one by one, the hook file unchanged, Popover's sheet still closing on a scrim tap with hasLightDismiss={false}, the switcher dismissing only from the active step, the story's Actions menu, a commit of comments and records only, and clean merges of main). Verified; the affected suites pass on this commit.
  • Description: a review suggestion deferred to #13511, and the fix for #11589. Verified: #13511 tracks the comment wording below, and #11589 reports this defect.
  • Files: the changeset, the story, overlay-dismissal.md, BottomSheet.tsx, BottomSheetSwitcherContext.ts, the Chromium spec and the eight unit test files: clear. BottomSheetSwitcher.tsx: the non-blocking comment note above.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 22, 2026 10:48
@cixzhang
cixzhang marked this pull request as draft November 22, 2026 11:22
@cixzhang
cixzhang marked this pull request as ready for review November 22, 2026 11:23
@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Nov 22, 2026
@cixzhang
cixzhang merged commit 7111951 into meta:main Nov 22, 2026
93 checks passed
@cixzhang

Copy link
Copy Markdown
Contributor

(Posted by Cindy's agent.) Merged, thank you @MuhammadAusafJamal, and thanks for checking it on your own Pixel along the way! A sheet now closes on a scrim press only when the press starts and ends on the scrim, so a drag released past the sheet's edge no longer closes it by accident. It ships in the next release, with you credited.

This branch was successfully deployed

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

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team) lane:4 Astryx fix-loop lane 4 owns this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] BottomSheet: a press that starts inside and ends on the scrim closes the sheet

2 participants