Skip to content

spec(Dialog, BottomSheetSwitcher): a switcher's active modal step wraps Tab like every modal - #10302

Draft
cixzhang wants to merge 1 commit into
mainfrom
spec/10238-switcher-tab-wrap
Draft

cixzhang wants to merge 1 commit into
mainfrom
spec/10238-switcher-tab-wrap

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Exact decision needed

Whether a BottomSheetSwitcher's active modal step wraps Tab through Core's shared focus-region module, like every other modal presentation. Today Dialog DEC-2 exempts switcher steps and BottomSheetSwitcher DEC-1 keeps them on native containment, so Tab from a step's last control (and Shift+Tab from its first) leaves the page for the browser's own interface (#10238).

Existing authority searched

  • Dialog DEC-2 (current): every modal presentation wraps Tab through one module. Its one exception is a step of the deprecated BottomSheetSwitcher.
  • BottomSheetSwitcher DEC-1 (current): each step owns its native dialog. A script focus trap on a step was rejected.
  • BottomSheetSwitcher lifecycle: deprecated (DEP-0015), still supported and maintained.

Decision

Proposed, pending owner review (option B). Dialog DEC-2 drops the exception and names the switcher's active step among modal presentations. BottomSheetSwitcher DEC-1 says the active step of a modal flow wraps Tab through the shared module, because native containment alone lets Tab leave. FR5 and the Modal state row follow, and FR5 records the implementation gap.

Rejected alternatives

  • A: keep the exemption, so keyboard users can still Tab out of a switcher step to the browser's interface.

Claim scope and non-goals

Only Tab containment on the active modal step. Not changed: the switcher's deprecation, its non-modal flows, step handoff, scrim, dismissal, scroll lock and focus return.

Evidence and implementation relationship

In real Chrome on main's Storybook, BottomSheetSwitcher "Hug content", 390 px and 1280 px wide: Tab from the step's last control (Continue) moves focus out of every open dialog, to the page body and then the browser's interface. The implementation follows in a separate pull request after this decision.

Writing rubric results

  • R1 narration: none.
  • R2 research in the record: none.
  • R3 evidence naming a change: none.
  • R4 rejected alternatives over one line or outside a decision: one line, inside DEC-1.
  • R5 pull request or issue references remaining: none added.
  • R6 ruled open questions still listing options: none.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal Meta context.

Validation

  • pnpm check:knowledge: aligned
  • Prettier: clean

@vercel

vercel Bot commented Nov 6, 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 6, 2026 4:03pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 6, 2026
@astracat-bot

astracat-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 6, 2026, 4:20 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 6, 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.

This spec change needs an engineering owner's decision before it can be approved, and one more record needs updating.

It intentionally changes two current decisions, the BottomSheetSwitcher-step exception in component:Dialog DEC-2 and the rejection of a script focus trap in component:BottomSheetSwitcher DEC-1, so approval waits on an engineering owner deciding that the active step of a modal switcher flow wraps Tab through the shared focus-region module. Any engineering owner, the author included, records that decision by commenting /approve-spec followed by the full head commit SHA.

Blocking

  • component:BottomSheet FR16 (docs/specs/components/BottomSheet/BottomSheet.spec.md, line 169) still says a switcher step is the exception to Dialog DEC-2; amend it in this pull request so the records agree, for example: "The active step of a modal BottomSheetSwitcher flow is a focus region the same way (component:BottomSheetSwitcher FR5)."

Also worth aligning: DEC-1 no longer lists focus containment among what the browser supplies, but the Ownership boundary, FR5 and the Modal row still credit native containment.

[Automated review]

Comment on lines +183 to +184
it, a modal BottomSheet, standalone or the active step of a
BottomSheetSwitcher, Lightbox, and a modal Drawer. A fault in the wrapping is

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.

Blocking: component:BottomSheet FR16 (docs/specs/components/BottomSheet/BottomSheet.spec.md, line 169) still ends "A switcher step (the deprecated BottomSheetSwitcher) is the exception to DEC-2, as component:Dialog DEC-2 states." With this sentence the two current records disagree. Please amend FR16 in this pull request, for example: "The active step of a modal BottomSheetSwitcher flow is a focus region the same way (component:BottomSheetSwitcher FR5)."

switcher steps alike and the browser supplies modality per step: an inert
page, focus containment, `cancel` for Escape and the platform close, and the
backdrop. The switcher owns only what no single dialog can decide: which dialog
page, `cancel` for Escape and the platform close, and the backdrop. The active

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.

Non-blocking: this sentence no longer lists focus containment among what the browser supplies per step. The Ownership boundary ("Focus containment is the native modal dialog's"), FR5 and the Modal row still credit native containment. Consider saying once that the native dialog makes the page inert and the shared focus-region module wraps Tab in the active step.

This branch was successfully deployed

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

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant