pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🐛[BUG]<ProFormSelect/> 组件打开搜索远程获取数据,获得搜索结果后,点击其中一个,会清空结果,然后触发 request,resetAfterSelect无效

Open 4wei opened this issue 1 year ago • 1 comments

提问前先看看:

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

🐛 bug 描述

<ProFormSelect/> 组件打开搜索远程获取数据,获得搜索结果后,点击其中一个,会清空结果,然后触发 request,resetAfterSelect无效

📷 复现步骤

1.输入搜索,获得下拉菜单 2.点击其中一个 3.搜索结果清空,除非request

🏞 期望结果

与antd 的<Select/>一样效果,获得搜索结果后,没有重新输入新搜索字段的情况下,保留上一次搜索结果,可重复选择

💻 复现代码

© 版本信息

  • ProComponents 版本: 2.6.28

🚑 其他信息

image

4wei avatar Oct 09 '23 07:10 4wei

rc-select内部的request实现就是在弹窗关闭时清理searchValue并触发request。用request看来是不行的,只能自己封装onSearch的逻辑。

https://github.com/react-component/select/blob/d905f984ceb296ca1d8d8737663c788bdcbfa407/src/BaseSelect.tsx#L451

yqz0203 avatar Apr 19 '24 07:04 yqz0203