Skip to content

feat(module:select): support nzOptionHeightPx in global config #8504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/core/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface SelectConfig {
nzBorderless?: boolean;
nzSuffixIcon?: TemplateRef<NzSafeAny> | string | null;
nzBackdrop?: boolean;
nzOptionHeightPx?: number;
}

export interface AffixConfig {
Expand Down
2 changes: 1 addition & 1 deletion components/select/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import { NzSelectModule } from 'ng-zorro-antd/select';
| `[nzMaxTagCount]` | Max tag count to show | `number` | - |
| `[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>;}>` | - |
| `[nzMaxTagPlaceholder]` | Placeholder for not showing tags | `TemplateRef<{ $implicit: any[] }>` | - |
| `[nzOptionHeightPx]` | Each option height inside the dropdown | `number` | `32` |
| `[nzOptionHeightPx]` | Each option height inside the dropdown | `number` | `32` |
| `[nzOptionOverflowSize]` | Max option size inside the dropdown, overflow when exceed the size | `number` | `8` |
| `[nzSelectOnTab]` | Allows to select an item with TAB key | `boolean` | `false` |
| `(ngModelChange)` | Current selected nz-option value change callback. | `EventEmitter<any[]>` | - |
Expand Down
2 changes: 1 addition & 1 deletion components/select/doc/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { NzSelectModule } from 'ng-zorro-antd/select';
| `[nzMaxTagCount]` | 最多显示多少个 tag | `number` | - |
| `[nzMaxTagPlaceholder]` | 隐藏 tag 时显示的内容 | `TemplateRef<{ $implicit: any[] }>` | - |
| `[nzOptions]` | option 列表,可以取代 nz-option,用法参见例子 | `Array<{ label: string \| number \| TemplateRef<any>; value: any; key?: string \| number; disabled?: boolean; hide?: boolean; groupLabel?: string \| TemplateRef<any>;}>` | - |
| `[nzOptionHeightPx]` | 下拉菜单中每个 Option 的高度 | `number` | `32` |
| `[nzOptionHeightPx]` | 下拉菜单中每个 Option 的高度 | `number` | `32` |
| `[nzOptionOverflowSize]` | 下拉菜单中最多展示的 Option 个数,超出部分滚动 | `number` | `8` |
| `[nzSelectOnTab]` | 允许使用 TAB 键选择项目 | `boolean` | `false` |
| `(ngModelChange)` | 选中的 nz-option 发生变化时,调用此函数 | `EventEmitter<any[]>` | - |
Expand Down
2 changes: 1 addition & 1 deletion components/select/select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon
@Input() nzId: string | null = null;
@Input() nzSize: NzSelectSizeType = 'default';
@Input() nzStatus: NzStatus = '';
@Input() nzOptionHeightPx = 32;
@Input() @WithConfig<number>() nzOptionHeightPx = 32;
@Input() nzOptionOverflowSize = 8;
@Input() nzDropdownClassName: string[] | string | null = null;
@Input() nzDropdownMatchSelectWidth = true;
Expand Down