Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

force primeng dropdown to pop up

Is there any way to force a primeng dropdown to show the options on top, drop up not as drop down, as the drop down makes scroll inside.

like image 650
kk nair Avatar asked Oct 15 '25 06:10

kk nair


1 Answers

Use appendTo="body" on dropdown to avoid scroll( assuming that its scroll on parent element ). Where to show popup is calculated depending on the position of dropdown in screen, better dont mess with that. You don't want to show pop "up" when the control is already at the top of screen.

<p-dropdown appendTo="body" [options]="cities1" [(ngModel)]="selectedCity1"></p-dropdown>
like image 149
sabithpocker Avatar answered Oct 17 '25 21:10

sabithpocker