Skip to content

Commit

Permalink
Fallback value to null instead of checking for NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
dfernandez-elastic committed Jul 18, 2024
1 parent b2b2caf commit 57d9556
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
* Decides how many selected item labels to show at most.
* @group Props
*/
@Input({ transform: numberAttribute }) selectionLimit: number | undefined;
@Input({ transform: (value: unknown) => numberAttribute(value, null) }) selectionLimit: number | null | 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 @@ -1471,10 +1471,6 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
}

isSelectionAllDisabled() {
if (this.showToggleAll && isNaN(this.selectionLimit)) {
return true;
}

return this.showToggleAll && ObjectUtils.isEmpty(this.selectionLimit);
}

Expand Down

0 comments on commit 57d9556

Please sign in to comment.