p-table - Virtualscroll does not work when p-table is used inside p-dialog
[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Plunkr Case (Bug Reports) https://stackblitz.com/edit/p-table-virtualscroll-bug?file=src/app/app.component.html
Current behavior When I'm using a p-table with virtualscrolling enabled inside a p-dialog, then the content of the table is barely visible.
Expected behavior I'm expecting the virtualscroll of p-table to be supported inside p-dialog too.
Please tell us about your environment: OS: Windows
-
Angular version: 11.0.4
-
PrimeNG version: 11.1.0
- Browser: Chrome
It also happens using VirtualScroller component itself (without table): https://stackblitz.com/edit/primeng-dialog-demo-pgz5bv?file=src%2Fapp%2Fapp.component.html
I suppose that for virtual scrolling some attributes like offsetTop are being used and they work different in a modal.
Related to https://github.com/primefaces/primeng/issues/9298
for me it doesn't work in fixed div that is dynamicaly hiden or shown.
Is there any plan to fix this bug? This is a significant bug, and a regression from past versions.
Whis the latest primeng version it is not working.
Hi,
So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!
Best Regards,
@vicesmat based off your stackblitz I found a pretty easy workaround for making virtualscroll vissible in p-dialog.
<p-dialog ... (onShow)="showDialog$.next(true)" (onHide)="showDialog$.next(false)"> <p-virtualScroller *ngIf="showDialog$ | async" ...>
Looks like there's a problem with timing of some logic execution in p-dialog and virtualscroll, when using p-dialog in html template, but making virtuallscroll displayed only when p-dialog opens up at least makes it work...