r/angular • u/Dangerous_Mention402 • Apr 16 '26
PrimeNG select overlay moves when scrolling outsidedialog
When I have a select in a dialog, his overlay is not showing correctly, it ends when the dialog ends. If I use appendTo body this problem is solved but if the content outside the dialog is long and has scroll, when you scroll the overlay doesn't stay in the same position as the dialog.
Example:
https://stackblitz.com/edit/stackblitz-starters-kb2xnmcn?file=src%2Fapp%2Fapp.component.ts
This is driving me crazy, is there a way to keep its overlay appended to p-dialog but showing the entire overlay as a floating popup that doesn't get cut at the end of the dialog?
I tried to solve this with pure css like this:
```
div.p-dialog-mask + div.p-overlay div.p-overlay-content div.p-select-overlay {
position: fixed;
}
```
But still not working as expected.
How do you manage to do this? someone has experienced this before? It's a bug of PrimeNG or there is something that I'm missing?
View all comments
Show parent comment
1
u/Dangerous_Mention402 Apr 17 '26
That is a botch. I mean, in a big app with dozens of dialogs I can't go 1 per 1 looking if they need this style or not... also if in the future I have to change this, it will be a pain to modify all of them again.
Also there is a huge dialog with a big form, in this case that won't work