Skip to content

[focusgroupV2] Define when grid topology can be inferred automatically #1496

Open

Description

@janewman

Focusgroup V2 currently has two explicit topology paths:

  • focusgroup="grid" discovers native HTML table structure.
  • focusgroup="grid manual" discovers direct-child rows marked with focusgrouprow.

Native tables provide an unambiguous automatic case. Simple generic markup may also contain enough structural information to infer rows and cells:

<div focusgroup="grid" aria-label="Palette">
  <div focusgrouprow>
    <div tabindex="0">Bold</div>
    <div tabindex="0">Italic</div>
  </div>
  <div focusgrouprow>
    <div tabindex="0">Left</div>
    <div tabindex="0">Right</div>
  </div>
</div>

Inference becomes less reliable when markup contains wrappers or multiple plausible row levels:

<div focusgroup="grid" aria-label="Palette">
  <div class="scrollport">
    <div focusgrouprow>
      <div tabindex="0">Bold</div>
      <div tabindex="0">Italic</div>
    </div>
  </div>
</div>

We should determine how much topology user agents can infer safely and where authors must provide explicit signals.

Questions to resolve:

  1. Is the presence of focusgrouprow sufficient to select generic topology?
  2. Which structural wrappers, if any, can be transparent to row discovery?
  3. What happens when multiple plausible row levels exist?
  4. How should mixed native and generic structures behave?
  5. Can mutations change the inferred topology mode?
  6. Is manual still useful as an explicit override or disambiguation signal?

When topology is ambiguous, invalidating the grid may be safer than selecting a plausible structure that can change unexpectedly. Authored ARIA roles should not select or alter focus topology.

Related:

Activity

  1. dmytrokirpa commented on Oct 22, 2026

    @dmytrokirpa

    Here's a calendar case where inferring topology from table structure gets in the way: non-interactive header cells.

    I'm working on the headless Calendar in Fluent UI. The day grid is a native table with weekday column headers and, optionally, week-number row headers. Both matter to screen reader users, and neither should be a navigation stop.

    <table role="grid" aria-label="September 2020" focusgroup="grid">
      <thead>
        <tr>
          <td></td> <!-- corner cell above the week-number column -->
          <th scope="col">Sunday</th>
          <th scope="col">Monday</th>
          <th scope="col">Tuesday</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row" aria-label="Week 37">37</th>
          <td tabindex="0"><button tabindex="-1" aria-label="September 6, 2020">6</button></td>
          <td tabindex="0"><button tabindex="-1" aria-label="September 7, 2020">7</button></td>
          <td tabindex="0"><button tabindex="-1" aria-label="September 8, 2020">8</button></td>
        </tr>
      </tbody>
    </table>

    The explainer treats every <td> and <th> as a cell. So the header row, the corner cell and the week-number column all need targets, and since they have none, the grid is invalid.

    What I tried:

    • grid manual handles weekday headers: a header row without focusgrouprow is simply ignored. But it means giving up the native table and its header associations. It also doesn't help with week numbers, because every direct child of an enrolled row becomes a cell.
    • Week numbers have no valid markup today. Inside the row they become a cell. Outside the row they're no longer part of the ARIA row. Making them focusable would add a navigation stop that users don't expect.
    • inert or hiding. Non-participating rows and columns are dropped from topology, but that also removes the headers from the accessibility tree, so it doesn't help.

    A few ideas, without being attached to any of them:

    1. In automatic table topology, leave out <thead> rows and <th> cells that have no focusable content. That would be a narrow, structural rule that fits native header semantics.
    2. Or add an explicit signal, such as an attribute on a row or cell meaning "structural, not a coordinate". That fits the issue's question about where authors should provide explicit signals.
    3. In manual mode, allow non-participating children inside an enrolled row, so a row header can sit next to the cells without becoming a coordinate.

    Inferring from <th> alone seems risky, because some grids have focusable, sortable headers that should be stops. That's an argument for (2), or for (1) only when the header has no focusable content.

    The unavailable-date side of the calendar is in #1495. Happy to share runnable repros if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions