ngx-scrollbar icon indicating copy to clipboard operation
ngx-scrollbar copied to clipboard

updated event firing twice

Open Ash66hub opened this issue 2 years ago • 2 comments

What are you trying to do?

@ViewChild(NgScrollbar) scrollable: NgScrollbar;
ngAfterViewInit() {
    this.scrollable.updated.pipe(takeUntil(this.destroyed$)).subscribe(() => { 
        // This is firing twice
    }
}

Environment

  • Angular: 15
  • ngx-scrollbar: 10.0.1
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Ash66hub avatar Aug 12 '23 05:08 Ash66hub

As a workaround, I've added throttleTime(200) for now

Ash66hub avatar Aug 14 '23 04:08 Ash66hub

Sure, it may update multiple time as long the scrollbar gets updated hence the name updated. in the new version, will improve how the update works with a reason parameter.

MurhafSousli avatar Aug 14 '23 15:08 MurhafSousli