Skip to content

Commit 4efc5ab

Browse files
authored
feat(module:select): support nzOptionHeightPx in global config (#8504)
Fixes #8503
1 parent b52ad50 commit 4efc5ab

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

components/core/config/config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export interface SelectConfig {
9393
nzBorderless?: boolean;
9494
nzSuffixIcon?: TemplateRef<NzSafeAny> | string | null;
9595
nzBackdrop?: boolean;
96+
nzOptionHeightPx?: number;
9697
}
9798

9899
export interface AffixConfig {

components/select/doc/index.en-US.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import { NzSelectModule } from 'ng-zorro-antd/select';
6161
| `[nzMaxTagCount]` | Max tag count to show | `number` | - |
6262
| `[nzOptions]` | use nzOptions or `nz-option` to pass options to the select | `Array<{ label: string \| number \| TemplateRef<any>; value: any; key?: string \| number; disabled?: boolean; hide?: boolean; groupLabel?: string \| TemplateRef<any>;}>` | - |
6363
| `[nzMaxTagPlaceholder]` | Placeholder for not showing tags | `TemplateRef<{ $implicit: any[] }>` | - |
64-
| `[nzOptionHeightPx]` | Each option height inside the dropdown | `number` | `32` |
64+
| `[nzOptionHeightPx]` | Each option height inside the dropdown | `number` | `32` |
6565
| `[nzOptionOverflowSize]` | Max option size inside the dropdown, overflow when exceed the size | `number` | `8` |
6666
| `[nzSelectOnTab]` | Allows to select an item with TAB key | `boolean` | `false` |
6767
| `(ngModelChange)` | Current selected nz-option value change callback. | `EventEmitter<any[]>` | - |

components/select/doc/index.zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ import { NzSelectModule } from 'ng-zorro-antd/select';
6262
| `[nzMaxTagCount]` | 最多显示多少个 tag | `number` | - |
6363
| `[nzMaxTagPlaceholder]` | 隐藏 tag 时显示的内容 | `TemplateRef<{ $implicit: any[] }>` | - |
6464
| `[nzOptions]` | option 列表,可以取代 nz-option,用法参见例子 | `Array<{ label: string \| number \| TemplateRef<any>; value: any; key?: string \| number; disabled?: boolean; hide?: boolean; groupLabel?: string \| TemplateRef<any>;}>` | - |
65-
| `[nzOptionHeightPx]` | 下拉菜单中每个 Option 的高度 | `number` | `32` |
65+
| `[nzOptionHeightPx]` | 下拉菜单中每个 Option 的高度 | `number` | `32` |
6666
| `[nzOptionOverflowSize]` | 下拉菜单中最多展示的 Option 个数,超出部分滚动 | `number` | `8` |
6767
| `[nzSelectOnTab]` | 允许使用 TAB 键选择项目 | `boolean` | `false` |
6868
| `(ngModelChange)` | 选中的 nz-option 发生变化时,调用此函数 | `EventEmitter<any[]>` | - |

components/select/select.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon
235235
@Input() nzId: string | null = null;
236236
@Input() nzSize: NzSelectSizeType = 'default';
237237
@Input() nzStatus: NzStatus = '';
238-
@Input() nzOptionHeightPx = 32;
238+
@Input() @WithConfig<number>() nzOptionHeightPx = 32;
239239
@Input() nzOptionOverflowSize = 8;
240240
@Input() nzDropdownClassName: string[] | string | null = null;
241241
@Input() nzDropdownMatchSelectWidth = true;

0 commit comments

Comments
 (0)