ant-design / ant-design

An enterprise-class UI design language and React UI library
https://ant.design
MIT License
92.49k stars 49.77k forks source link

🐛[BUG]Pro Table 在树形结构下,选择多选框报错 #21526

Closed Lanboo closed 4 years ago

Lanboo commented 4 years ago

🐛 bug 描述

在树形结构下,选择多选框报错

📷 复现步骤

我在浏览器中Debug,原因如下:

// http://localhost:8000/node_modules/antd/es/table/hooks/useLazyKVMap.js
var dig = function dig(records) {
    records.forEach(function (record, index) {  //1
        var rowKey = getRowKey(record, index);
        kvMap.set(rowKey, record);

        if (childrenColumnName in record) {
            dig(record[childrenColumnName]);   //2
        }
    });
};

当列表中某个数据存在childrenColumnName字段时,不论是否为空,都会dig回调,从而在1处报错

🏞 期望结果

选择多选框不会报错

💻 复现代码

© 版本信息

🚑 其他信息

ant-design-bot commented 4 years ago

Hello @Lanboo, your issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue, thank you!

你好 @Lanboo,为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 issue 助手 来创建 issue 以方便我们定位错误。谢谢配合!

chenshuai2144 commented 4 years ago

ref https://github.com/ant-design/ant-design/pull/21528