Skip to content

Commit

Permalink
CuppaLabs#613 Fix: Cannot add property 0, object is not extensible
Browse files Browse the repository at this point in the history
Solution: Cloning the array together with the new value.
  • Loading branch information
reinoboonstra committed Apr 1, 2022
1 parent 8422dae commit 3a7fd6d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export class AngularMultiSelect implements OnInit, ControlValueAccessor, OnChang
this.closeDropdown();
}
else
this.selectedItems.push(item);
this.selectedItems = [...this.selectedItems, item];
this.onChangeCallback(this.selectedItems);
this.onTouchedCallback(this.selectedItems);
}
Expand Down

0 comments on commit 3a7fd6d

Please sign in to comment.