ant-design / ant-design/pro-components
为什么ProTable的search里的submitterColSpanProps里的span属性一定要number类型?
- 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
### 🧐 问题描述
submitterColSpanProps的span设置为number类型后,当页面宽度比较小的时候并在submit区域添加多一个按钮后,submit区域就有可能超出页面
### 💻 示例代码
submit区域有可能超出页面
```
search={{
layout: "horizontal",
optionRender: (searchConfig, props, dom) => [
...dom,
,
,
],
labelWidth: "auto",
collapseRender: false,
collapsed: false,
submitterColSpanProps: { span: 8, flex: "auto" },
}}
```
submit区域可以正常换行
```
search={{
layout: "horizontal",
optionRender: (searchConfig, props, dom) => [
...dom,
,
,
],
labelWidth: "auto",
collapseRender: false,
collapsed: false,
submitterColSpanProps: { span: "auto" as unknown as number, flex: "auto" },
}}
```
### 🚑 其他信息
类型定义

span设置为number超出页面

span设置为auto正常显示

Contributor guide
Research direction
Start at ProTable's search entry point and inspect the type definition for submitterColSpanProps, especially span. Reproduce the supplied narrow-screen example with an added optionRender button, comparing a numeric span with the demonstrated auto value. Done means the submit area can wrap responsively without requiring an unsafe type cast.
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