[AnalyticalTable]: useF2CellEdit inserts "undefined" into grid-cell aria-label

Open Beginner friendly
#9,171 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Lukas742 is already working on this.

Since Nov 26, 2026.

  • #9173 by @Lukas742 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript

Research direction

The bad label is built in packages/main/src/components/AnalyticalTable/pluginHooks/useF2CellEdit.ts, near line 82, where the cell's aria-label is concatenated from a label that can be missing. Start there and trace where the label text comes from when no cellLabel callback is passed. Done means a cell with no explicit label gets no literal "undefined" in its aria-label, and the existing AnalyticalTable tests for F2 cell editing still pass.

Written by the indexing model from the issue text.

Description

SAP SF
Describe the bug

When AnalyticalTable uses useF2CellEdit with a custom link cell and no explicit cellLabel, the hook generates:
aria-label="Includes Link undefined"
The cell contains a valid, populated link title. The literal undefined comes from concatenating a missing aria-label, rather than missing application data.
This can produce an incorrect screen-reader announcement and obscure the actual cell content.

https://github.com/UI5/webcomponents-react/blob/5ee63707e54ff08a930845f2ca8c9c5e8cad3866/packages/main/src/components/AnalyticalTable/pluginHooks/useF2CellEdit.ts#L82

Isolated Example

No response

Reproduction steps
import {
  AnalyticalTable,
  AnalyticalTableHooks,
  Link,
  ThemeProvider
} from "@ui5/webcomponents-react";
import type {
  AnalyticalTableCellInstance,
  AnalyticalTableColumnDefinition
} from "@ui5/webcomponents-react";

const { useF2CellEdit } = AnalyticalTableHooks;

function TitleCell(props: AnalyticalTableCellInstance) {
  const ref = useF2CellEdit.useCallbackRef(props);

  return (
    <Link href="#review" ref={ref}>
      {props.value}
    </Link>
  );
}

const columns: AnalyticalTableColumnDefinition[] = [
  {
    id: "title",
    Header: "Title",
    accessor: "title",
    Cell: TitleCell,
    interactiveElementName: "Link"
  }
];

export default function App() {
  return (
    <ThemeProvider>
      <AnalyticalTable
        columns={columns}
        data={[{ title: "Annual Review" }]}
        tableHooks={[useF2CellEdit]}
      />
    </ThemeProvider>
  );
}

  1. Render the table above without a cellLabel callback.
  2. Inspect the first body cell with role="gridcell".
  3. Observe aria-label="Includes Link undefined".
Expected Behaviour

Missing optional labels should not become the literal string undefined.

Screenshots or Videos

No response

UI5 Web Components for React Version

2.28.2

UI5 Web Components Version

2.28.1

Browser

Edge

Operating System

No response

Additional Context

No response

Relevant log output

Organization

SF

Declaration
  • I’m not disclosing any internal or sensitive information.
Dominant language
TypeScript
Stars
544
Forks
113
Avg merge
1d 16h
Merged PRs (30d)
34

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from UI5/webcomponents-react

All issues in UI5/webcomponents-react

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.