简体   繁体   中英

primeng p-dropdown not firing onShow, onHide event

I am using primeng version 6.1.0 in my angular app version 6. I am facing an issue where i want to trigger an event on closing p-dropdown, not by selecting any item but by clicking outside the p-dropdown list. I have already used click event so, I want another work around to fire and event upon closing of primeng dropdown.

I have tried onHide event by primeng p-dropdown documentation

in html:

<p-dropdown (click)="clickToDisable()" [options]="activeCustomerStatus" [(ngModel)]="selectedFilterStatus" optionLabel="label" 
 (onHide)="enableButton($event)"></p-dropdown>

in component:

enableButton($event) {
console.log('onHideWorks');
}

Output: By using onHide, that console message should be displayed on console.

As I can see (cause I could not find the 6.1.0 docs for dropdown), at version 6.1.0 the onHide event emitter wasn't available

GitHub/PrimeNg/Dropdown

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM