Skip to content

Commit

Permalink
CustomSelect: fix onSelect; fixes #37
Browse files Browse the repository at this point in the history
  • Loading branch information
vrimar committed Aug 6, 2020
1 parent bdab6b6 commit 142f8e8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/custom-select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ export class CustomSelect extends AbstractComponent<ICustomSelectAttrs> {
}

private handleSelect = (item: Option) => {
if ('value' in this.attrs) {
safeCall(this.attrs.onSelect, item);
} else this.selected = item;
if (!('value' in this.attrs)) {
this.selected = item;
}

safeCall(this.attrs.onSelect, item);
this.isOpen = false;
}

Expand Down

0 comments on commit 142f8e8

Please sign in to comment.