[bug] Quickly expanding several lines with a custom asychronous ExpandIcon onExpand call results in only one line expansion open
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
先从 issue 中的 App.jsx 复现开始,或打开链接的 CodeSandbox,然后跟踪涉及自定义 expandIcon 和延迟 onExpand 回调的 Table 展开流程。完成的标准是:在一秒延迟下快速点击多行后,每个被点击的行都保持展开,而不只是最后一行。
由索引模型根据 Issue 内容生成。
描述
Custom ExpandIcon quick expansion
How to reproduce
- Open the below code sandbox, or copy the below provided code into a project: CodeSandbox
- Open several rows in less than one second
Expected behavior: All the rows that have been clicked open and stay open
Actual behavior: The rows open, but close whenever another open and at the end, only one is open
This only happens when the clicking is done faster than the delay after which onExpand is called
Note:
- The code sandbox uses the following versions: "antd": "5.2.3", "react": "18.2.0"
- The problem has also been experienced with Ant Design 4.22.7, and React 17.0.2
App.jsx
I copy the code here in case the codesandbox is inaccessible or lost somehow.
import { Table } from "antd";
import "./styles.css";
export default function App() {
return (
<div className="App">
<h1>Hello Ant Design rc-table</h1>
<Table
columns={[{ dataIndex: "key" }]}
dataSource={[{ key: "bamboo" }, { key: "oak" }, { key: "cinnamon" }]}
expandable={{
expandedRowRender: (record) => <span>row-content-{record.key}</span>,
expandIcon: ({ onExpand, expanded, record }) => {
return (
<button
onClick={() => {
setTimeout(() => onExpand(record), 1000);
}}
>
{expanded ? "-" : "+"}
</button>
);
}
}}
/>
</div>
);
}
- 主要语言
- TypeScript
- 星标
- 1.4k
- 派生
- 619
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
react-component/table 的其他 Issue
-
Fixed-header tables force one getBoundingClientRect per column on every mount (ResizeObserver-driven MeasureCell)可能已有人在做 @rubenmarcus 于 11 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 42/100
react-component/table#1507 ·
-
rowExpandable does not work when dataSource has children field可能已有人在做 @nrps9909 于 45 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 50/100
react-component/table#1416 ·
-
难度 5/5 一周以上 新手友好度 30/100
react-component/table#1403 ·
-
难度 5/5 一周以上 新手友好度 15/100
react-component/table#1269 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
react-component/table#1257 · 1 个 reaction ·
查看 react-component/table 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
NousResearch/hermes-agent#136483 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
[Bug]: Web chat input doesn't regain focus after a reply finishes可能已有人在做 @GaijinSystems 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
zeroclaw-labs/zeroclaw#11658 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
babylonlabs-io/babylon-toolkit#2711 ·
维护者通常 1 天内回复