You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rowExpandable does not work when dataSource has children field #1416
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';constdataSource=[{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},];constcolumns=[{title: 'Name',dataIndex: 'name',key: 'name',},];constApp=()=>(<TabledataSource={dataSource}columns={columns}expandable={{// This is ignored because children field existsrowExpandable: (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.
Activity