Skip to content

fix(core): a Table stays the scroll region when a host scrolls every table's parent - #12357

Closed
josephfarina wants to merge 2 commits into
mainfrom
josephfarina/table-content-not-scroller
Closed

josephfarina wants to merge 2 commits into
mainfrom
josephfarina/table-content-not-scroller

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Some pages that show an Astryx page inside another app add a global rule that gives the parent of every <table> overflow-x: auto. Inside a Table, that parent is the box between the scroll wrapper and the <table>. That box then scrolled instead of the wrapper. The wrapper never overflowed, so a wide Table lost its named scroll region, its focus ring, and its overflow state. In Chromium the inner box still took an unnamed tab stop of its own. Now the wrapper stays the scroll region on such pages.

Problem and solution fit

  • Why does it happen? The host rule sits outside any cascade layer. An unlayered rule beats every class in Astryx's cascade layers, whatever its specificity.
  • Why does it matter? Keyboard and screen-reader users reach an unnamed scroller instead of the Table's named region and its focus ring, and features that read the Table's overflow state do not see it.
  • The fix: the Table's inner content box gets an inline overflow: visible on both axes. An inline style beats the unlayered host rule. Both axes stay visible, because a host overflow shorthand would otherwise leave overflow-y: auto, and CSS then computes a lone visible axis to auto.

Expected behavior and authority

component:Table FR1: one named scroll region around one observed content box. spec:AST-025: one viewport owns scrolling.

Smallest restoration

One inline style on the content box in Table.tsx. No other Core component has a <table> as the direct child of its scroll content. Lab's DiffViewer does (its unified view) and stays open to the same host rule; it is left to its own change.

Evidence

  • Reproduction before the change: with the host rule in place before the story renders (overflow-x: auto, and the overflow: auto shorthand), the wrapper does not overflow and the new browser cases fail at the wrapper's scrollWidth > clientWidth check.
  • Result after the change: in both cases the inner box computes visible on both axes, and the wrapper overflows, reports inline overflow, and has tabindex="0".
  • Representative unchanged path: the two existing Table scroll browser tests pass.

Scope

Components: Table

  • 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

  • playwright test --project=chromium TableScroll against a built Storybook (two new cases: overflow-x: auto and overflow: auto host rules, injected before render)
  • vitest run packages/core/src/Table, tsc -p packages/core/tsconfig.build.json

@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 4:53pm 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, 4:59 PM 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 · 68b7bba

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
Markdown 205.3 kB (+20 B) · 22.1 kB CSS (0) —
Table 121.8 kB (+19 B) · 19.8 kB CSS (0) —
lab/Comments 376.9 kB (+17 B) · 2.5 kB CSS (0) —
8 more components
Component Size LoC
lab/CommentThread 370.1 kB (+10 B) · 2.4 kB CSS (0) —
TableBody 3.5 kB (0) · 3.3 kB CSS (0) —
TableCell 104.6 kB (0) · 19.3 kB CSS (0) —
TableFooter 3.5 kB (0) · 3.3 kB CSS (0) —
TableHeader 3.5 kB (0) · 3.3 kB CSS (0) —
TableHeaderCell 104.4 kB (0) · 19.1 kB CSS (0) —
TableRow 7.1 kB (0) · 4.0 kB CSS (0) —
TableSelectionToolbar 76.5 kB (0) · 14.1 kB CSS (0) —

Package size: @astryxdesign/core 7.65 MB packed (+589 B); no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

Current run: CI concluded cancelled; parts of this report may be missing.


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.

Changes requested. The fix works: with the host rule from the new test, the Table's wrapper is the scroller again and takes the tab stop, and pages without such a rule are unchanged. Two claims in the description are not accurate at this head:

  • The description says no other component has a <table> as the direct child of its scroll content, but Lab's DiffViewer renders its unified-view <table> directly inside its scroll content box (packages/lab/src/DiffViewer/DiffViewer.tsx) and the same host rule moves its scrolling to that inner box, so please reword this to "no other Core component" and name DiffViewer as a remaining case, or give its content box the same style.
  • The description says keyboard users cannot reach a wide table, but in Chromium the browser makes the inner scroller its own unnamed tab stop, so please reword it to say that users lose the Table's named scroll region and focus ring rather than all keyboard access.

Two non-blocking notes are in the inline comments: the new browser case's attribute checks also pass on the base, and a host rule that uses the overflow shorthand still makes the inner box scroll.

Claims and files checked

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

  • Claim: a host rule giving every table's parent overflow-x: auto made the inner box scroll instead of the wrapper: verified in Chromium on the base.
  • Claim: the wrapper then lost its keyboard stop, focus ring and overflow state: verified (no tabindex and no data-scrollable-inline on the base).
  • Claim: the wrapper now stays the scroll region on such pages: verified (browser probe and the new test on the head).
  • Claim: an unlayered host rule beats Astryx's layered classes: verified (packages/build/src/index.js emits library CSS inside @layer).
  • Claim: keyboard users cannot reach a wide table: false in Chromium (Tab reaches the unnamed inner scroller).
  • Claim: features that read the overflow state did not see it: verified.
  • Claim: the inline overflow-x: visible beats the host rule, so the inner box never scrolls: verified for the described rule; an overflow shorthand rule is not covered (non-blocking).
  • Claim: Table FR1 and the one-viewport scroll spec govern the behavior: verified.
  • Claim: one inline style in Table.tsx is the smallest restoration: verified.
  • Claim: no other component has a <table> directly in its scroll content: false (Lab DiffViewer).
  • Claim: before the change the inner box computed auto and the new test failed: verified (the new case fails on the base at the computed-style check).
  • Claim: after the change the inner box is visible and the wrapper overflows with tabindex="0": verified.
  • Claim: the two existing Table scroll browser tests pass: verified (3 of 3 pass on the head).
  • Claim: scope checklist (one defect, no tagalong, no new API or default, no internal context): verified; the public API surface is unchanged.
  • Claim: Table unit tests and the type check pass: verified (906 tests at this head; the description's 893 is a stale count).
  • Changeset: a Table stays the one scroll region under such a host rule, and before, the inner box scrolled and the Table lost its keyboard stop and focus ring: verified.
  • File .changeset/table-content-not-scroller.md: clear.
  • File packages/core/src/Table/Table.tsx: non-blocking (overflow shorthand host rule; comment wording).
  • File packages/core/src/Table/__tests__/TableScroll.a11y.chromium.spec.ts: non-blocking (the attribute checks pass on the base).

Automated review (maintainer link)

Comment thread packages/core/src/Table/Table.tsx 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. The CI workflow was refused for capacity and its jobs were cancelled, so it needs a re-run before merge.

The latest commit resolves every earlier point: the description now names Lab's DiffViewer as the remaining exposed case and states the keyboard impact accurately, the inline style keeps both axes visible so an overflow shorthand host rule no longer wins, and both new browser cases add the rule before render and fail on the base.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: host pages that give every table's parent an unlayered overflow-x: auto rule make the box between the wrapper and the table scroll instead: verified in Chromium on the base (the inner box scrolls 360 px in 318 px; the wrapper does not overflow).
  • Claim: the Table then loses its named scroll region, focus ring and overflow state, and Chromium gives the inner box an unnamed tab stop: verified (no tabindex or data-scrollable-inline on the wrapper; Tab lands on the inner box).
  • Claim: an unlayered rule beats Astryx's layered classes and an inline style beats that rule: verified (library CSS is emitted inside @layer; the inline style wins on the head).
  • Claim: both axes must stay visible because a shorthand host rule leaves overflow-y: auto and a lone visible axis computes to auto: verified (the head keeps the inner box visible on both axes under both rules).
  • Claim: keyboard and screen-reader users reach an unnamed scroller and overflow-state readers miss the overflow: verified.
  • Claim: Table FR1 and the one-viewport scroll spec govern the behavior: verified.
  • Claim: one inline style in Table.tsx is the restoration, and no other Core component has a <table> directly in its scroll content while Lab's DiffViewer does: verified.
  • Claim: both new browser cases fail on the base at the wrapper overflow check and pass on the head, and the two existing scroll cases pass: verified (4 of 4 on the head; the two new cases fail on the base).
  • Claim: Table unit tests and the Core type check pass: verified (906 tests).
  • Claim: scope checklist (one defect, no tagalong, no hidden API, visual, default or interaction change, no internal context): verified; the public API surface is unchanged and pages without such a rule render identically.
  • Changeset: the Table stays the one scroll region under an overflow-x: auto host rule, where the inner box used to scroll and the Table lost its keyboard stop and focus ring: verified.
  • File .changeset/table-content-not-scroller.md: clear.
  • File packages/core/src/Table/Table.tsx: clear.
  • File packages/core/src/Table/__tests__/TableScroll.a11y.chromium.spec.ts: clear.

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 18, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12252 docs(cli): agent docs name the prop names that differ from other libraries
  Author: Joey Farina <[email protected]>
- #12154 fix(core): a numeric typography weight builds through an extended base's adaptation rules
  Author: Joey <[email protected]>
- #12092 fix(cli): theme build reads the Core it builds with for variant declarations, and names the build command alone
  Author: Joey Farina <[email protected]>
- #12316 fix(core): a shorthand never follows its own longhand in one style merge
  Author: josephfarina <[email protected]>
- #12357 fix(core): a Table stays the scroll region when a host scrolls every table's parent
  Author: Joey Farina <[email protected]>
- #12349 fix(core): end a mouse drag a sandboxed frame never saw released
  Author: josephfarina <[email protected]>
- #12425 fix(cli): use a stored doc parse only with the zod release that made it
  Author: Joey <[email protected]>
- #12396 fix(AppShell): with the standard width points, a server-rendered shell hides its inline side nav on a phone before its script runs
  Author: Joey <[email protected]>
- #12438 fix(charts): end dots draw whole and a thinned axis keeps its last label
  Author: Joey Farina <[email protected]>
- #12448 fix(cli): upgrade outside a project names the project, not --from
  Author: Joey Farina <[email protected]>
- #12459 fix(templates): the dashboard scorecard fits a phone screen
  Author: Joey Farina <[email protected]>
- #12428 fix(core): Field labels draw in a bolder face than their description
  Author: Joey Farina <[email protected]>
- #12435 fix(theme-matcha): dark menus, popovers and muted fills take the theme's deep gray neutral
  Author: Joey <[email protected]>
- #12432 fix(templates): dashboard chart labels show whole instead of clipped by the chart edge
  Author: Joey Farina <[email protected]>
- #12441 fix(cli): mark icon-set generated calls pure so apps drop unused icons
  Author: Joey Farina <[email protected]>
- #12472 fix(MetadataListItem): a value breaks only a word longer than its line
  Author: Joey <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12718.

@github-actions
github-actions Bot deleted the josephfarina/table-content-not-scroller branch November 19, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 68b7bbab 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