NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.87k stars 3.94k forks source link

nzSelect has white/empty space in compact theme #7304

Open geesen opened 2 years ago

geesen commented 2 years ago

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-ivy-4tffxv

Steps to reproduce

What is expected?

No white/empty space. Compare with react in compact theme: https://ant.design/components/select/?theme=compact#components-select-demo-automatic-tokenization

What is actually happening?

In compact theme there is an empty space after all options. It seems that the space increases with more options. This only occurs when you need to scroll.

Environment Info
ng-zorro-antd 13.1.1
Browser Chrome 98, Edge 99

Maybe, the size/height of the CDK's virtual scroll viewport is calculated based on the option-height from the normal theme and not from the compact theme?

cipchk commented 2 years ago

@geesen You can only add the [nzOptionHeightPx]="24" property in nz-select component. Currently, there is no relevant code that can only detect it.

vhphuc commented 1 year ago

how do i set nzOptionHeigtPx to nz-select of nz-table pagination