How do i add up and down arrow based on p-dropdown menu open #26
-
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @mdnafeed! You can add custom icons in multiple ways: 1-) You can access the p-dropdown with ViewChild and use the overlayVisible property for the check. 2-) You can use emitters of p-dropdown. Create a local boolean something like dropdownVisible.
Apply icons:
3-) You can use dropdownicon template Regards. |
Beta Was this translation helpful? Give feedback.
-
Hii @yigitfindikli in component we have multiple how to up and down icon change based on click when multiple have any solution please add on stackblitz |
Beta Was this translation helpful? Give feedback.
Hi @mdnafeed!
You can add custom icons in multiple ways:
1-) You can access the p-dropdown with ViewChild and use the overlayVisible property for the check.
Demo: https://stackblitz.com/edit/kbepji?file=src%2Fapp%2Fdemo%2Fdropdown-basic-demo.ts
2-) You can use emitters of p-dropdown. Create a local boolean something like dropdownVisible.
Apply icons:
get getDropdownIcon() { return this.dropdownVisible ? 'pi pi-caret-up' : 'pi pi-caret-down'; }
<p-dropdown ... [dropdownIcon]="getDropdownIcon"></p-dropdown>
3-) You can use dropdownicon template
Regards.