ant-design / ant-design/pro-components

🐛[BUG] ProFormSelect在readonly模式下,传入空数组,这个字段会什么也不显示

Open
#8,848 1 comment 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

### 🐛 bug 描述

ProFormSelect组件在readonly模式下,传入空数组,这个字段的值什么也不显示
如果传入空字符串,null之类的空值,会显示'-'
虽然这个组件类型上不支持emptyText,实际试了一下,emptyText在传空字符串或者null的时候是生效的

### 🏞 期望结果

希望能在传空数组的情况也显示有意义的空内容,最好能一起支持emptyText
大概看了下很多组件实际都支持emptyText,只是类型和文档里没有

### © 版本信息

- ProComponents 版本: 2.17.1
- 浏览器环境 chrome 130
- 开发环境 mac os

Contributor guide

Open the contributing guide

Research direction

Start with the ProFormSelect component and trace its readonly rendering for an empty array, then compare it with the existing empty-string and null handling. Check how emptyText is currently accepted at runtime and represented in the component types and documentation; done means empty arrays show meaningful empty content and emptyText is consistently supported.

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.