swimlane / ngx-datatable

✨ A feature-rich yet lightweight data-table crafted for Angular
http://swimlane.github.io/ngx-datatable/
MIT License
4.63k stars 1.68k forks source link

Some rows are not rendered after filtering in virtual scrolling mode #985

Open Alex-Tsyganok opened 7 years ago

Alex-Tsyganok commented 7 years ago

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior When rows filtered in virtual scrolling model, scroll position is not resets, and rows rendered with offset. image

Expected behavior Correct rows rendering

Reproduction of the problem Open demo Scroll grid several rows down image Apply filter that returns empty rows collection by clicking toggle filter button image Remove filter by clicking toggle filter button image

What is the motivation / use case for changing the behavior? Fix incorrect rendering

Please tell us about your environment:

wizarrc commented 7 years ago

Looks like another case of offset bounds checking. I wonder if this is already fixed by https://github.com/swimlane/ngx-datatable/pull/980

@amcdnl Might be a dup of https://github.com/swimlane/ngx-datatable/issues/978

artfuldev commented 5 years ago

This is a problem with the virtualization scroller not updating its scrollTop. As a workaround we can do this.table.bodyComponent.offsetY = 0; every time we load a new set of rows where this.table is the @ViewChild(DatatableComponent)