Skip to content

AbstractRow never populates rowheaders/columnheaders (no-op concat) #658

Description

@fpigeonjr

Context

Found while adding specs for #635.

AbstractRow._setRowHeaders (src/ui-kit/experimental/aria/abstract-grid/abstract-row.ts) does:

private _setRowHeaders(cells: AbstractCell[], role: CellRole): void {
  if (role === "rowheader") {
    this.rowheaders.concat(cells);
  } else if (role === "columnheader") {
    this.columnheaders.concat(cells);
  } else {
    return;
  }
}

Array.prototype.concat returns a new array rather than mutating in place, and the result is discarded here. So the public rowheaders/columnheaders properties on AbstractRow are always empty, regardless of the row's actual DOM content — only the flattened cells collection reflects reality.

Suggested fix

Assign the result, e.g. this.rowheaders = this.rowheaders.concat(cells);, and add spec coverage asserting the header collections are populated correctly.

Origin

Flagged by Copilot review on PR #654 (#654 (comment)). Left out of that PR since it is a spec-only PR and this is a pre-existing implementation bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions