Skip to content

fix(core): remove misleading TabList orientation prop#4293

Open
HelloOjasMutreja wants to merge 2 commits into
facebook:mainfrom
HelloOjasMutreja:fix/tablist-remove-orientation-prop
Open

fix(core): remove misleading TabList orientation prop#4293
HelloOjasMutreja wants to merge 2 commits into
facebook:mainfrom
HelloOjasMutreja:fix/tablist-remove-orientation-prop

Conversation

@HelloOjasMutreja

Copy link
Copy Markdown
Contributor

Summary

Fixes #4231.

TabList exposed an orientation?: 'horizontal' | 'vertical' prop that implied vertical tab strips existed. They do not. The prop only controlled which arrow icons appeared in the ephemeral keyboard-hint badge (useKeyboardHint). It had zero effect on:

  • Layout -- the strip always renders horizontally.
  • Arrow-key navigation -- useListFocus has always used orientation: 'both', accepting all four arrow axes unconditionally per the WAI-ARIA tab APG.
  • aria-orientation -- deliberately never set (invalid on the navigation role; triggers an axe aria-allowed-attr violation).

Keeping the prop lets consumers believe they can render vertical tabs when they cannot. Removing it is the honest fix.

Changes

packages/core

  • TabList.tsx -- remove orientation from TabListProps and the function signature; call useKeyboardHint() with no arguments (defaults to 'horizontal'); update stale comment in useListFocus block.
  • TabListContext.ts -- remove the now-unused TabListOrientation type.
  • TabList.test.tsx -- update the aria-orientation regression test to remove the orientation="vertical" rerender (the invariant itself is still tested).
  • TabList.doc.mjs -- remove orientation from the props table.

packages/cli (codemod)

  • transforms/v0.1.9/remove-tablist-orientation.mjs -- strips orientation from all <TabList> usages. Import-source-aware (@astryxdesign/core, @astryxdesign/core/TabList, @xds/core, @xds/core/TabList), alias-aware.
  • transforms/v0.1.9/index.mjs -- v0.1.9 transform manifest.
  • transforms/v0.1.9/__tests__/remove-tablist-orientation.test.mjs -- 8 tests: both orientation values, expression values, aliases, subpath imports, no-op paths, non-regression for other components.
  • codemods/registry.mjs -- registers '0.1.9' in the upgrade registry.

Changeset

[breaking] (0.x minor bump) for @astryxdesign/core. Consumers run astryx upgrade to auto-remove the prop.

Behavior change

The only observable difference is the keyboard-hint badge: it now always shows left/right arrows (the useKeyboardHint default) rather than up/down arrows when orientation="vertical" was passed. This is correct -- both axes have always worked regardless.

Testing

  • 45/45 TabList.test.tsx tests pass.
  • 8/8 codemod unit tests pass.
  • Full @astryxdesign/core build clean (Babel + tsc + CSS + UMD).

@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 25, 2026 5:49am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 24, 2026
@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 labels Jul 24, 2026
@HelloOjasMutreja
HelloOjasMutreja marked this pull request as ready for review July 25, 2026 05:31
The orientation prop did not render vertical tabs. It only toggled the
keyboard-hint badge arrows (horizontal vs vertical). Arrow-key navigation
has always accepted both axes unconditionally via orientation: 'both' in
useListFocus, and aria-orientation was deliberately never set on the nav
(invalid on the navigation role, triggers axe aria-allowed-attr).

Remove the prop to prevent consumers from assuming a vertical tab-strip
layout exists. Keyboard behavior is unchanged.

Adds a v0.1.9 codemod (astryx upgrade) that strips orientation from
all TabList usages. Includes 8 codemod unit tests and a [breaking] changeset.

Closes facebook#4231
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. 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TabList: remove the misleading orientation prop (no real vertical tabs; it only drives the keyboard hint)

1 participant