From c053430f44cd7ee0d39a22ed1ab3c3c7ac927d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20FINDIKLI?= Date: Wed, 13 Oct 2021 14:35:47 +0300 Subject: [PATCH] Fixed #10712 - Add onClear event to dropdown --- src/app/components/dropdown/dropdown.ts | 3 +++ src/app/showcase/components/dropdown/dropdowndemo.html | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/app/components/dropdown/dropdown.ts b/src/app/components/dropdown/dropdown.ts index 11cbc3b32a8..5e6739fb76b 100755 --- a/src/app/components/dropdown/dropdown.ts +++ b/src/app/components/dropdown/dropdown.ts @@ -270,6 +270,8 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView @Output() onHide: EventEmitter = new EventEmitter(); + @Output() onClear: EventEmitter = new EventEmitter(); + @ViewChild('container') containerViewChild: ElementRef; @ViewChild('filter') filterViewChild: ElementRef; @@ -1238,6 +1240,7 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView }); this.updateSelectedOption(this.value); this.updateEditableLabel(); + this.onClear.emit(event); } onOverlayHide() { diff --git a/src/app/showcase/components/dropdown/dropdowndemo.html b/src/app/showcase/components/dropdown/dropdowndemo.html index 0ebf199acde..b848c72b353 100755 --- a/src/app/showcase/components/dropdown/dropdowndemo.html +++ b/src/app/showcase/components/dropdown/dropdowndemo.html @@ -576,6 +576,11 @@
Events
event: Animation event Callback to invoke when dropdown overlay gets hidden. + + onClear + event: Animation event + Callback to invoke when dropdown clears the value. +