mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
docs: Add faq about item height (#21433)
* docs: Add faq about item height * update
This commit is contained in:
parent
8738e1a623
commit
0ea16a8841
@ -100,3 +100,13 @@ Select component to select value from options.
|
||||
### The dropdown is closed when click `dropdownRender` area?
|
||||
|
||||
See the [dropdownRender example](/components/select/#components-select-demo-custom-dropdown-menu).
|
||||
|
||||
### Why sometime customize Option cause scroll break?
|
||||
|
||||
Virtual scroll internal set item height as `32px`. You need to adjust `listItemHeight` when your option height is less and `listHeight` config list container height:
|
||||
|
||||
```tsx
|
||||
<Select listItemHeight={10} listHeight={250} />
|
||||
```
|
||||
|
||||
Note: `listItemHeight` and `listHeight` are internal props. Please only modify when necessary.
|
||||
|
@ -103,3 +103,13 @@ title: Select
|
||||
### 点击 `dropdownRender` 里的内容浮层关闭怎么办?
|
||||
|
||||
看下 [dropdownRender 例子](/components/select-cn/#components-select-demo-custom-dropdown-menu) 里的说明。
|
||||
|
||||
### 自定义 Option 样式导致滚动异常怎么办?
|
||||
|
||||
这是由于虚拟滚动默认选项高度为 `32px`,如果你的选项高度小于该值则需要通过 `listItemHeight` 属性调整,而 `listHeight` 用于设置滚动容器高度:
|
||||
|
||||
```tsx
|
||||
<Select listItemHeight={10} listHeight={250} />
|
||||
```
|
||||
|
||||
注意:`listItemHeight` 和 `listHeight` 为内部属性,如无必要,请勿修改该值。
|
||||
|
@ -81,3 +81,7 @@ Tree selection control.
|
||||
### How to get parent node in onChange?
|
||||
|
||||
We don't provide this since performance consideration. You can get by this way: <https://codesandbox.io/s/wk080nn81k>
|
||||
|
||||
### Why sometime customize Option cause scroll break?
|
||||
|
||||
You can ref Select [FAQ](/components/select).
|
||||
|
@ -82,3 +82,7 @@ title: TreeSelect
|
||||
### onChange 时如何获得父节点信息?
|
||||
|
||||
从性能角度考虑,我们默认不透出父节点信息。你可以这样获得:<https://codesandbox.io/s/wk080nn81k>
|
||||
|
||||
### 自定义 Option 样式导致滚动异常怎么办?
|
||||
|
||||
请参考 Select 的 [FAQ](/components/select)。
|
||||
|
Loading…
Reference in New Issue
Block a user