diff --git a/src/app/components/multiselect/multiselect.ts b/src/app/components/multiselect/multiselect.ts index c1e55e47633..afc1f56c8f5 100755 --- a/src/app/components/multiselect/multiselect.ts +++ b/src/app/components/multiselect/multiselect.ts @@ -264,7 +264,7 @@ export class MultiSelectItem {
this.maxSelectedLabels ? this.modelValue().slice(0, this.maxSelectedLabels) : this.modelValue(); }); - constructor( - public el: ElementRef, - public renderer: Renderer2, - public cd: ChangeDetectorRef, - public zone: NgZone, - public filterService: FilterService, - public config: PrimeNGConfig, - public overlayService: OverlayService - ) { + constructor(public el: ElementRef, public renderer: Renderer2, public cd: ChangeDetectorRef, public zone: NgZone, public filterService: FilterService, public config: PrimeNGConfig, public overlayService: OverlayService) { effect(() => { const modelValue = this.modelValue(); @@ -1216,6 +1208,9 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft } maxSelectionLimitReached() { + if (this.selectionLimit === 0) { + return true; + } return this.selectionLimit && this.modelValue() && this.modelValue().length === this.selectionLimit; }