question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Virtual scroll - bug on the official example

See original GitHub issue
[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 Rows are not rendered when scrolling to the bottom of the table too fast with virtualization enabled.

Expected behavior Rows should be rendered properly even when scrolled fast.

Reproduction of the problem

  1. Open http://swimlane.github.io/ngx-datatable/#virtual-scroll
  2. Grab the scrollbar with your mouse and scroll to the bottom of the table.

Please tell us about your environment: Windows 10 64bit

  • Table version:
  • Angular version:
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] Chrome 80, Firefox 73.

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Eloi-Marincommented, Oct 17, 2020

I fixed the issue this way. Create a rxjs Subject:

scrollEvent: Subject<void> = new Subject();

then:

this.scrollEvent.pipe( debounceTime(100), map(_ => this.tableRef.offset), distinctUntilChanged(), ).subscribe(() => this.tableRef.element.getElementsByTagName(‘datatable-body’)[0].scrollTop++ );

and for the ngx-datatable scroll output, emit scrollEvent:

[html] (scroll)=“scrollEvent.next()”

Works pretty well with Angular 10.1.1 and ngx-datatable 18.0.0

0reactions
Hypercubedcommented, Apr 20, 2021

I have a PR coming that should fix the demo and give some improved details on implementation: https://github.com/swimlane/ngx-datatable/pull/1991

Read more comments on GitHub >

github_iconTop Results From Across the Web

Virtual scroll official examples for treepanel generating ...
To replicate the issue, you just have to expand one of the nodes displayed in the virtual scroll example. I am particularly interested...
Read more >
iharbeck/ngx-virtual-scroller - npm
ngx-virtual-scroller. Virtual Scroll displays a virtual, "infinite" list. Supports horizontal/vertical, variable heights, & multi-column.
Read more >
virtual-scrolling bug with the firsts elements - EJ 2 Forums
I create a TreeGrid with virtual scroll is enable and the first element dissapears randomly, is the same in your exemple ...
Read more >
Scrolling | Angular Material
Virtual scrolling is different from strategies like infinite scroll where it renders a set amount of elements and then when you hit the...
Read more >
Angular Material Virtual Scrolling - Step-By-Step Explanation
This video is part of the Angular Material In Depth Course - https://angular-university.io/course/angular-material-courseCheck out the PDF ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found