rowExpandable does not work when dataSource has children field
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 50/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
Table のエントリーポイントから開始し、レコードに children が含まれている場合に expandable.rowExpandable がどのように処理されるかを追跡します。children 配列が 1 つは要素あり、もう 1 つは空の例を再現し、その後、最初の行だけに展開アイコンが表示され、tree モードで rowExpandable が呼び出されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Description
When using rc-table with tree data structure (when dataSource contains children field), the rowExpandable configuration is completely ignored. This prevents developers from controlling which rows should be expandable based on custom logic.
Current Behavior
When dataSource contains children field, the table automatically enables tree mode
In tree mode, the presence of children field alone determines expandability, regardless of its content
Empty children arrays ([]) still show expand icons
The rowExpandable function is never called or its return value is ignored
Expected Behavior
rowExpandable should work consistently regardless of whether the table is in tree mode or not
Developers should be able to control expandability using custom logic even when children field exists
When rowExpandable returns false for a row, it should not show expand icon regardless of children field
import { Table } from 'rc-table';
const dataSource = [
{
key: '1',
name: 'Parent 1',
children: [
{ key: '1-1', name: 'Child 1-1' },
],
},
{
key: '2',
name: 'Parent 2',
children: [], // Empty children - should not be expandable
},
];
const columns = [
{
title: 'Name',
dataIndex: 'name',
key: 'name',
},
];
const App = () => (
<Table
dataSource={dataSource}
columns={columns}
expandable={{
// This is ignored because children field exists
rowExpandable: (record) =>
record.children && record.children.length > 0
}}
/>
);
In this example, both rows show expand icons, but the second row should not be expandable since its children array is empty.
- 主要言語
- TypeScript
- スター
- 1.4k
- フォーク
- 618
- 平均マージ
- 10時間 19分
- マージ済み PR(30日)
- 2
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react-component/table のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
react-component/table#1507 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
react-component/table#1403 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
react-component/table#1269 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
react-component/table#1257 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
react-component/table#1228 ·
react-component/table の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
area:tools bug good first issue help wanted priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
TaewoooPark/Motifcode#14 ·
-
bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
BasedHardware/omi#15320 ·
-
難易度 2/5 半日 初心者へのやさしさ 78/100
vercel/vercel-plugin#199 ·