primeng icon indicating copy to clipboard operation
primeng copied to clipboard

p-dropdown still causes page to horizontally scroll

Open eduardtyutyunik opened this issue 4 years ago • 4 comments

Originally posted by @eduardtyutyunik in https://github.com/primefaces/primeng/issues/10992#issuecomment-1008839338

Hi. Sorry, but it doesn't really fixed the issue. If you put the dropdown to the right half of the page. In your example: <p-dropdown [options]="cities" [(ngModel)]="selectedCity1" placeholder="Select a City" optionLabel="name" [showClear]="true" style="margin-left: 300px;"> then the horizontal scroll also happens. The same problem is in the paginator of tables. If the page has a horizontal scroll and the padinator of the table is on the right half of the page, the page scrolls horizontally when the paginator will be oppend.

https://stackblitz.com/edit/primeng-tablepage-demo-qcryef?file=src%2Fapp%2Fapp.component.html

eduardtyutyunik avatar Jan 10 '22 12:01 eduardtyutyunik

My work around to this issue was to make it appendTo='body'. This resolved the shifting.

I also had to add paginatorDropdownAppendTo='body' to my tables so that the paginator did not show the same problems.

waratah avatar Jan 11 '22 01:01 waratah

My work around to this issue was to make it appendTo='body'. This resolved the shifting.

I also had to add paginatorDropdownAppendTo='body' to my tables so that the paginator did not show the same problems.

Thank you. It works! I think it has to be a default behaviour (at least for tables).

eduardtyutyunik avatar Jan 11 '22 07:01 eduardtyutyunik

Verified fixed on 13.0.4

waratah avatar Jan 13 '22 01:01 waratah

I'm still seeing the issue on 13.4.1 and the scrollTo= option isn't changing the behavior. My dropdown is in the right half of the screen. Any other suggestions? Is there a stackblitz out there showing the fix for a dropdown in the right portion of the screen?

wojo2020 avatar May 25 '22 13:05 wojo2020