I am trying to display dropdown options panel programmatically by calling show method of the p-dropdown but options panel is not displaying. When I called the show method, the "overlayVisible" variable is set to true but I cannot see the option panel open.
Code: Select all
"primeflex": "^2.0.0",
"primeicons": "^4.1.0",
"primeng": "^11.4.4",
Code: Select all
<p-dropdown [options]="alertOptions" [(ngModel)]="alertValue" #alertType placeholder="Choose Alert Type"> </p-dropdown>
<p-button type="button" label="Show Alert Options" (onClick)="show()"> </p-button>
Code: Select all
import { Dropdown } from 'primeng/dropdown';
@ViewChild('alertType') alertType: Dropdown;
show() {
this.alertType.show();
}
Thanks