@@ -59,7 +59,12 @@ import {
5959 OnChangeType ,
6060 OnTouchedType
6161} from 'ng-zorro-antd/core/types' ;
62- import { fromEventOutsideAngular , getStatusClassNames , isNotNil } from 'ng-zorro-antd/core/util' ;
62+ import {
63+ fromEventOutsideAngular ,
64+ getStatusClassNames ,
65+ isNotNil ,
66+ numberAttributeWithInfinityFallback
67+ } from 'ng-zorro-antd/core/util' ;
6368import { NZ_SPACE_COMPACT_ITEM_TYPE , NZ_SPACE_COMPACT_SIZE , NzSpaceCompactItemDirective } from 'ng-zorro-antd/space' ;
6469
6570import { NzOptionContainerComponent } from './option-container.component' ;
@@ -246,7 +251,7 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon
246251 @Input ( ) nzMenuItemSelectedIcon : TemplateRef < NzSafeAny > | null = null ;
247252 @Input ( ) nzTokenSeparators : string [ ] = [ ] ;
248253 @Input ( ) nzMaxTagPlaceholder : TemplateRef < { $implicit : NzSafeAny [ ] } > | null = null ;
249- @Input ( ) nzMaxMultipleCount = Infinity ;
254+ @Input ( { transform : numberAttributeWithInfinityFallback } ) nzMaxMultipleCount = Infinity ;
250255 @Input ( ) nzMode : NzSelectModeType = 'default' ;
251256 @Input ( ) nzFilterOption : NzFilterOptionType = defaultFilterOption ;
252257 @Input ( ) compareWith : ( o1 : NzSafeAny , o2 : NzSafeAny ) => boolean = ( o1 : NzSafeAny , o2 : NzSafeAny ) => o1 === o2 ;
@@ -271,8 +276,12 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon
271276 return this . _nzShowArrow === undefined ? this . nzMode === 'default' : this . _nzShowArrow ;
272277 }
273278
279+ get isMultiple ( ) : boolean {
280+ return this . nzMode === 'multiple' || this . nzMode === 'tags' ;
281+ }
282+
274283 get isMaxMultipleCountSet ( ) : boolean {
275- return this . nzMaxMultipleCount !== Infinity ;
284+ return this . isMultiple && this . nzMaxMultipleCount !== Infinity ;
276285 }
277286
278287 get isMaxMultipleCountReached ( ) : boolean {
0 commit comments