Skip to content

Commit

Permalink
Remove unneeded check
Browse files Browse the repository at this point in the history
  • Loading branch information
anjmao committed Sep 25, 2017
1 parent 289c73a commit 16662c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/lib/src/items-list.ts
Expand Up @@ -25,9 +25,6 @@ export class ItemsList {
}

select(item: NgOption): boolean {
if (this._selected.indexOf(item) > -1) {
return false;
}
if (!this._multiple) {
this.clearSelected();
}
Expand Down
7 changes: 5 additions & 2 deletions src/lib/src/ng-select.component.ts
Expand Up @@ -260,9 +260,12 @@ export class NgSelectComponent implements OnInit, ControlValueAccessor {
}

select(item: NgOption) {
if (this.itemsList.select(item)) {
this.updateModel();
if (item.selected) {
return;
}

this.itemsList.select(item);
this.updateModel();
if (!this.multiple) {
this.close();
}
Expand Down

0 comments on commit 16662c2

Please sign in to comment.