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

未關閉 適合新手
#9,171 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@Lukas742 已經在處理了。

開始於 2026年11月26日。

  • #9173 來自 @Lukas742 —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
74/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
react, typescript

研究方向

錯誤的標籤是在 packages/main/src/components/AnalyticalTable/pluginHooks/useF2CellEdit.ts 第 82 行附近組出來的,此處儲存格的 aria-label 是由一個可能缺漏的標籤串接而成。從這裡開始,追蹤在未傳入 cellLabel 回呼時標籤文字的來源。完成標準是:沒有明確標籤的儲存格,其 aria-label 中不再出現字面值 "undefined",且現有的 AnalyticalTable F2 儲存格編輯測試仍然通過。

由索引模型根據 Issue 內容生成。

描述

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.
主要語言
TypeScript
星號
544
分支
113
平均合併
1 天 16 小時
30 天內合併 PR
34

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

UI5/webcomponents-react 的其他 Issue

查看 UI5/webcomponents-react 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。