Skip to content

Commit

Permalink
Check selection limit when limit changes (#12797)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyjus25 authored Aug 21, 2023
1 parent b42f6f9 commit e0c0f5c
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,6 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
* @group Props
*/
@Input() maxSelectedLabels: number = 3;
/**
* Number of maximum options that can be selected.
* @group Props
*/
@Input() selectionLimit: number | undefined;
/**
* Label to display after exceeding max selected labels e.g. ({0} items selected), defaults "ellipsis" keyword to indicate a text-overflow.
* @group Props
Expand Down Expand Up @@ -705,6 +700,17 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
this._itemSize = val;
console.warn('The itemSize property is deprecated, use virtualScrollItemSize property instead.');
}
/**
* Number of maximum options that can be selected.
* @group Props
*/
@Input() get selectionLimit(): number | undefined {
return this._selectionLimit;
}
set selectionLimit(val: number | undefined) {
this._selectionLimit = val;
this.checkSelectionLimit();
}

@ViewChild('container') containerViewChild: Nullable<ElementRef>;

Expand Down Expand Up @@ -796,6 +802,8 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft

_itemSize: number | undefined;

_selectionLimit: number | undefined;

public value: any[] | undefined | null;

public _filteredOptions: any[] | undefined | null;
Expand Down

0 comments on commit e0c0f5c

Please sign in to comment.