Skip to content

fix(core): a vertical Step with separated indicators keeps its content within the step - #12310

Merged
josephfarina merged 2 commits into
mainfrom
josephfarina/stepper-vertical-body-fits
Nov 17, 2026
Merged

josephfarina merged 2 commits into
mainfrom
josephfarina/stepper-vertical-body-fits

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A vertical Stepper with separated indicators (the default) that expands a step's content (an inline wizard) breaks on a phone when that content holds a wide field such as a Selector. The step's body grows wider than the step, so the whole content area scrolls sideways, field text is cut at the right edge, and the Selector menu opens partly off-screen. At 390 px and 375 px wide the content area was 425 px wide. After this fix it fits the screen.

Problem and solution fit

  1. Why does the content spill? The vertical step body is a flex: 1 item in the step's row, and a flex item's default min-width: auto floors it at its content's min-content width. One wide descendant sets that floor above the step's width.
  2. Why does that hurt the task? The body cannot shrink to the step, so everything inside it (fields, descriptions, the field's menu anchor) is laid out for a wider box than the screen.
  3. Why does that matter? A wizard on a phone becomes unusable without sideways scrolling, and its menus open off-screen.

The fix resets the floor on the vertical body (min-width: 0), as the horizontal step and the on-track vertical body already do. The body then takes the step's width, and its content wraps inside it.

Expected behavior and authority

A step's content stays within the step. The horizontal step and the on-track vertical body already do this: each already resets the same floor for the same reason.

Smallest restoration

One declaration on the vertical step body. No API, visual or default changes.

Evidence

  • Reproduction before the change: the inline form-wizard template, at 390 px and 375 px, light and dark: the content area is 425 px wide and scrolls sideways; the Selector anchor spans 58 to 417 px and its menu 31 to 390 px.
  • Result after the change: the content area is 390 px or 375 px wide (no sideways scroll); the Selector anchor spans 58 to 362 px, and its menu opens aligned with it.
  • Representative unchanged path: at 1280 px the layout is the same before and after (anchor and menu at 298 to 1012 px).
  • Wider check: an 82-page phone and dark-mode set at 390 px and 375 px gains this page (all views pass) and loses none.
  • Regression test or other mutation-sensitive proof: a new Stepper test checks that the vertical step body has min-width: 0. It fails without the fix.

Scope

Components: Stepper

  • 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

  • vitest run packages/core/src/Stepper: 118 tests pass.
  • Real browser (Chromium): the inline form-wizard template built with Vite, at 390, 375 and 1280 px, light and dark. I measured the content area's scroll width and the Selector anchor and menu bounds before and after the change.

The vertical step body is a flex item of the step row. Its default
min-width: auto floored it at its content min-content width, so a wide
field in an expanded step pushed the body past the step and the page
scrolled sideways on a phone. The body now resets the floor, as the
horizontal step and the on-track body already do.
@vercel

vercel Bot commented Nov 17, 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 17, 2026 11:44am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 11:55 AM UTC

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

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 4ec96da

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Step 31.6 kB (+2 B) · 5.6 kB CSS (0) — ✓ · ✓ · ✓
Stepper 67.6 kB (0) · 10.9 kB CSS (0) — ✓ · ✓ · ✓

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: unknown (base surface unavailable): richtext, theme-butter, theme-chocolate, theme-gothic, theme-matcha, theme-neutral, theme-stone, theme-y2k

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

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

Requesting changes for one wording fix; the layout fix itself is right.

  • The release note and the title say every vertical Stepper step had this bug, but steps with indicatorPosition="on-track" already kept their content inside the step, so please name the separated (default) layout, for example: "A vertical Stepper step with separated indicators (the default) keeps its content within the step."

In Chromium the change does what it says for the default layout: at 390 and 375 px the inline form-wizard step stays on screen and the Selector menu opens inside the viewport, a long label ellipsizes at 320 px, and the 1280 px layout is pixel-identical. A non-blocking note on the new source comment's sentence length is inline.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Release note and title, a vertical step keeps its content within the step: false for on-track vertical steps, which already did (identical frames at 390 px); verified for the separated layout.
  • Release note, before the fix a wide field pushed the body past the step, the page scrolled sideways, text was cut and the dropdown opened off-screen: verified for the separated layout (template step body to 441 px at 390 px; menu partly past the right edge).
  • Release note, the body now shrinks to the step's width and content wraps inside it: verified (Step.tsx:353; the template body ends at the step's edge).
  • Description, the body is a flex: 1 item floored by min-width: auto: verified (Step.tsx:327-354).
  • Description, the horizontal step and the on-track vertical body already reset the floor: verified (Step.tsx:372, Step.tsx:891).
  • Description, one declaration with no API, visual or default change: verified (public surface unchanged; frames identical when content fits).
  • Description, measured widths before and after (content area, field anchor and menu at 390, 375 and 1280 px): verified in direction; offsets depend on the host page (here a 441 px body, field 87-396 px and menu 52-411 px before, field 87-309 px after at 390 px; menu 298-1012 px at 1280 px on both).
  • Description, a wider phone and dark-mode page set passes: not reproduced; the set is not in the repository.
  • Description, the new test fails without the fix: verified (fails on the base, passes on the head).
  • Description, 118 Stepper tests pass: verified.
  • Description, no new public API, default or interaction model: verified.
  • Commit message, the body resets the floor as the horizontal and on-track bodies do: verified.
  • .changeset/stepper-vertical-body-fits.md: scope finding above.
  • packages/core/src/Stepper/Step.tsx: clear; non-blocking comment-style note.
  • packages/core/src/Stepper/Stepper.test.tsx: clear.

Automated review (maintainer link)

Comment thread packages/core/src/Stepper/Step.tsx Resolved
@josephfarina josephfarina changed the title fix(core): a vertical Step keeps its content within the step fix(core): a vertical Step with separated indicators keeps its content within the step Nov 17, 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.

Approved pending CI: CI is still running on this head.

The release note and the title now name the separated layout, and the source comment keeps only its reason, so both earlier points are resolved. In Chromium the fix does what it says: at 390 and 375 px the inline form-wizard step stays on screen and the Selector menu opens inside the viewport, a long label ellipsizes at 320 px, and on-track steps and the 1280 px layout are unchanged.

Claims and files checked

Review mode: incremental; reason: none

  • Release note and title, a vertical step with separated indicators (the default) keeps its content within the step: verified (separated is the default position, Stepper.tsx:244; the step body now ends at the step's edge).
  • Release note, before the fix a wide field pushed the body past the step, the page scrolled sideways, text was cut and the dropdown opened off-screen: verified at 390 and 375 px (template step body to 441 px; the menu ends past the right edge).
  • Release note, the body now shrinks to the step's width and the content wraps inside it: verified (Step.tsx:352); text that can wrap wraps, and one-line descriptions ellipsize under their own component's rule.
  • Description, the body is a flex: 1 item floored by min-width: auto: verified (Step.tsx:327-353).
  • Description, the horizontal step and the on-track vertical body already reset the floor: verified (Step.tsx:371, Step.tsx:890).
  • Description, content area, field and menu bounds before and after at 390, 375 and 1280 px: verified in direction; the offsets depend on the host page.
  • Description, a wider phone and dark-mode page set gains this page and loses none: not reproduced; the set is not in the repository.
  • Description, the new test fails without the fix: verified (fails on the base, passes on the head).
  • Description, 118 Stepper tests pass: verified.
  • Description, one declaration with no API, visual representation or default change: verified (public surface unchanged; frames identical where content fits).
  • Latest commit message, the note names the separated layout and the comment is shorter: verified.
  • .changeset/stepper-vertical-body-fits.md: clear.
  • packages/core/src/Stepper/Step.tsx: clear.
  • packages/core/src/Stepper/Stepper.test.tsx: clear.

Automated review (maintainer link)

@josephfarina
josephfarina merged commit 417d9ef into main Nov 17, 2026
90 checks passed
@github-actions
github-actions Bot deleted the josephfarina/stepper-vertical-body-fits branch November 18, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 4ec96da8 Deployed Nov 17, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant