Table: support column header navigation when empty

Author: coolassassinCreated May 27, 2026Updated Sep 17, 2026
LabelsenhancementTable

Provide a general summary of the feature here

UPDATE: Summary of issue is that columns may contain menus with filters that end up with an empty table. Users need to be able to access those menus when the table is empty to clear the filter and bring back content. See https://github.com/adobe/react-spectrum/issues/10121#issuecomment-5721063368 for possible direction

--Historical issue contents-- With roving tabIndex, first Tab into <Table> uses useSelectableCollection + GridKeyboardDelegate.getFirstKey(), which targets the first body row/cell. Apps that need first Tab on columnheader (sortable headers, WCAG patterns) must manually fight focusedKey, grid tabIndex={0}, and per-cell tabIndex overrides.

Expected Behavior?

Prop such as initialFocusTarget="firstColumnHeader" (or autoFocus="firstHeader") that sets initial focusedKey to the first column and moves DOM focus accordingly.

Current Behavior

On the first Tab into a RAC <Table>:

While focusedKey is null, the [role="grid"] gets tabIndex={0}. onFocus calls getFirstKey(), which picks the first body row (and with focusMode: 'cell' — the first body cell). Column headers are not used as the initial target. Items get tabIndex={0} only when their key matches focusedKey; everything else is -1. There is no prop to start Tab on the first columnheader, and

does not expose keyboardDelegate to override this.

Result: first Tab lands on the grid or a body cell, not the header. Apps that need header-first Tab must patch tabIndex and focus manually.

Possible Solution

useSelectableCollection (onFocus ~366, tabIndex ~594), GridKeyboardDelegate.getFirstKey, TableKeyboardDelegate (columns are isCell but excluded from getFirstKey).

Context

Table with header + body, Tab from outside → focus lands on first body cell, not first columnheader.

Workaround for today: Custom marshal + tabIndex overrides in app code (react-aria-components Table consumers).

Examples

No response

Your Company/Team

No response

Tracking Issue

No response