rowExpandable does not work when dataSource has children field
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 50/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu từ điểm vào Table và theo dõi cách expandable.rowExpandable được xử lý khi các bản ghi bao gồm children. Tái hiện ví dụ với một mảng children có phần tử và một mảng rỗng, sau đó xác minh rằng chỉ hàng đầu tiên hiển thị biểu tượng mở rộng và rowExpandable được gọi trong chế độ cây.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.4k
- Fork
- 618
- Merge trung bình
- 10 giờ 19 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của react-component/table
-
Fixed-header tables force one getBoundingClientRect per column on every mount (ResizeObserver-driven MeasureCell)Có thể đã có người làm @rubenmarcus đã nhận 6 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
react-component/table#1507 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
react-component/table#1403 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
react-component/table#1269 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
react-component/table#1257 · 1 reaction ·
-
Table cells are announced as "clickable" by screen readerCó thể đã có người làm @nrps9909 đã nhận 40 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
react-component/table#1228 ·
Tất cả issue của react-component/table
Issue tương tự
-
fix: txId branch of the contract-state streams drops every state after the named transactionĐang mởbot:ai-assisted status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
midnightntwrk/midnight-js#1424 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mksglu/context-mode#1268 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Edit:Đang mởcheck:failed streams:edit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
iptv-org/iptv#54352 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Table] reserveSelectedRowOnPaginate=false 时表头全选包含其他页数据Có thể đã có người làm @dvd233 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Tencent/tdesign-react#4416 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:widget bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
interledger/publisher-tools#894 ·
Maintainer thường phản hồi trong vòng 1 ngày