ant-design / ant-design/pro-components

🐛[BUG] CellEditorTable 的column valueType是select的时候,当该单元格失去焦点导致select 的request再次调用

Open
#8,928 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 描述
在CellEditorTable里面,该字段依赖其他字段初始化selectOptions,但是当select的单元格失去焦点的时候,select 的request再次调用,实际上已经有数据了就不要在调用了

### 📷 复现步骤

https://codesandbox.io/p/sandbox/vigorous-rgb-kypfxg
操作
1.先点击第一行活动名称单元格,不要修改字符串(如果不点击该单元格,直接点击状态单元格,会导致拉不出来的数据)
2.点击状态单元格,会触发request请求,选择某个option
3.空白处,使状态单元格失去焦点,发现再次产生了request
### 🏞 期望结果
只有依赖字段更新时候,才调用select 的request,当select的单元格失焦的时候,不要再调用requst

### 💻 复现代码
https://codesandbox.io/p/sandbox/vigorous-rgb-kypfxg

### © 版本信息

- ProComponents 版本: [2.8.2]
- chrome最新
- 开发环境 [windows]

### 🚑 其他信息

Contributor guide

Open the contributing guide

Research direction

Start with the CellEditorTable behavior shown in the linked CodeSandbox and reproduce the three-step sequence, watching when the select request runs. Trace the selectOptions dependency and blur flow; done means the request runs for initial loading or dependency changes, but not again when the cell merely loses focus.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.