ant-design / ant-design/pro-components

🐛[BUG] 在LightFilter中使用ProFormSelect的两个bug反馈

Open
#8,152 3 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 描述
场景:在LightFilter中使用ProFormSelect
问题1:当ProFormSelect的label是dom时,选中label后,回显的内容为[object,object]
问题2:为了解决问题1,我选择用optionLabelProp自定义回显内容,但是不生效

fieldProps里多个属性都没有效果,如optionLabelProp、dropdownRender、onDropdownVisibleChange等没效果,去掉外层LightFilter就没有问题

📷 复现代码
问题1:

```

男, value: 'aaa' },
{ label:

, value: 'bbb' },
]}
/>

问题2:

```
🏞 期望结果
问题1:能正常回显下拉中可视的label内容
问题2:能按照optionItemRender指定的key进行回显

fieldProps里多个属性都没有效果,如optionLabelProp、dropdownRender、onDropdownVisibleChange等没效果,去掉外层LightFilter就没有问题

© 版本信息
ProComponents 版本: ^2.5.3
umi 版本: umi4 umi max
antd版本:^5.5.2
浏览器环境:chrome 版本 114.0.5735.106(正式版本) (arm64)
开发环境:mac OS

🚑 其他信息
注:去掉LightFilter包裹后,以上问题均不存在

Contributor guide

Open the contributing guide

Research direction

Start with LightFilter wrapping ProFormSelect and compare it with the same component outside LightFilter, as described in the reproduction. Investigate how the wrapper handles DOM labels, optionLabelProp, optionItemRender, dropdownRender, and onDropdownVisibleChange; done means selected labels render correctly and these fieldProps take effect inside LightFilter.

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.