Skip to content

Commit

Permalink
Add onDropDownOpen() output (correct PR NileshPatel17#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
clongmoon authored May 5, 2020
1 parent 1dee820 commit fa4e40c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ng-multiselect-dropdown/src/multiselect.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export class MultiSelectComponent implements ControlValueAccessor {

@Output("onFilterChange")
onFilterChange: EventEmitter<ListItem> = new EventEmitter<any>();

@Output("onDropDownOpen")
onDropDownOpen: EventEmitter<ListItem> = new EventEmitter<any>();

@Output("onDropDownClose")
onDropDownClose: EventEmitter<ListItem> = new EventEmitter<any>();

Expand Down Expand Up @@ -294,8 +298,10 @@ export class MultiSelectComponent implements ControlValueAccessor {
return;
}
this._settings.defaultOpen = !this._settings.defaultOpen;
if (!this._settings.defaultOpen) {
this.onDropDownClose.emit();
if (this._settings.defaultOpen) {
this.onDropDownOpen.emit();
} else {
this.onDropDownClose.emit();
}
}

Expand Down

0 comments on commit fa4e40c

Please sign in to comment.