ant-design / ant-design/pro-components

🐛[BUG] DrawerForm 存在的 onFinish 存在执行上下文问题

Open
#8,644 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

### 🐛 bug 描述

2个问题:
- 1 handleFinish 存在执行上下文问题!存在闭包问题?
- 2 onFinish return true,没有关闭弹窗!

### 📷 复现步骤

复现路径
- 点击 record0,然后点击 record1,然后再点击 record0
- 此时问题出来了:控制台打印“handleFinish 1”合理的是 “handleFinish 0”

### 🏞 期望结果

合理的是 “handleFinish 0”

### 💻 复现代码

https://codesandbox.io/p/sandbox/drawer-biao-dan-forked-yrqxt3

### © 版本信息

- ProComponents 版本: [2.7.15]
- antd 5.20.0
- 浏览器环境 chrome
- 开发环境 [mac OS]

### 🚑 其他信息

补充,使用 ModalForm 没有此问题

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox reproduction and compare DrawerForm with ModalForm using ProComponents 2.7.15 and antd 5.20.0. Follow the record0 → record1 → record0 sequence and inspect the handleFinish and onFinish behavior. Done means the final selection logs “handleFinish 0” and returning true closes the drawer.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.