ant-design / ant-design/pro-components

👑 [需求]ProTable 里配置columns , valueType: 'treeSelect'的时候,有个场景跟antd的TreeSelect组件不符

Open
#8,448 6 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

### 🔩 组件:ProTable

### 🥰 需求描述

搜索之后选择可清空搜索 如下图
搜索ss
![image](https://github.com/ant-design/pro-components/assets/130677115/c0f99ba2-182e-447a-acb4-db707e04da8f)

选中后:
![image](https://github.com/ant-design/pro-components/assets/130677115/f03e8418-e36a-4f73-9cc9-50ca143eb5d0)

pro-components里面给的示例 如下图
搜索0-0
![image](https://github.com/ant-design/pro-components/assets/130677115/83c2c374-e9ab-4973-b36b-591576e695ba)

选中后没有清空0-0
![image](https://github.com/ant-design/pro-components/assets/130677115/6403a365-174d-4c1a-9629-6beb2870a4b4)

配置了这个属性也不生效autoClearSearchValue
![image](https://github.com/ant-design/pro-components/assets/130677115/0c3ec86e-cf17-4c4c-8191-dc6f6f708183)

猜测可能是ProTable里面用的TreeSelect版本不一致?

现在已经用renderFormItem替换掉 Protable自己的 valueType: 'treeSelect',

### ⛰ 功能需求适用场景

当多选模式下值被选择,自动清空搜索框

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the ProTable columns configuration using valueType: 'treeSelect' in multiple-selection mode, then compare its search behavior with the antd TreeSelect example. Check whether autoClearSearchValue is passed through, and compare with the renderFormItem workaround mentioned in the issue. Done means the search text clears after a selection without replacing the built-in valueType.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.