I want to display a message when the user stop scrolling with the Virtual Scroll. I tried the following approach, but the message i want to display never appear when i stop scrolling.
this.scrollDispatcher.scrolled().pipe(
tap(() => this.scroll = true),
debounceTime(100))
.subscribe(event => {
this.scroll = false;
console.log('scrolling stopped');
});
<div style="position: fixed; top: 50%; left: 50%" *ngIf="!scroll">Scrolling stopped</div>
What's wrong with my code ? There's a better working approach ?
Thanks