Skip to content

Commit

Permalink
Fixed #10712 - Add onClear event to dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Oct 13, 2021
1 parent 0e423b6 commit c053430
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView

@Output() onHide: EventEmitter<any> = new EventEmitter();

@Output() onClear: EventEmitter<any> = new EventEmitter();

@ViewChild('container') containerViewChild: ElementRef;

@ViewChild('filter') filterViewChild: ElementRef;
Expand Down Expand Up @@ -1238,6 +1240,7 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView
});
this.updateSelectedOption(this.value);
this.updateEditableLabel();
this.onClear.emit(event);
}

onOverlayHide() {
Expand Down
5 changes: 5 additions & 0 deletions src/app/showcase/components/dropdown/dropdowndemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ <h5>Events</h5>
<td>event: Animation event</td>
<td>Callback to invoke when dropdown overlay gets hidden.</td>
</tr>
<tr>
<td>onClear</td>
<td>event: Animation event</td>
<td>Callback to invoke when dropdown clears the value.</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit c053430

Please sign in to comment.