ngx-scrollbar
ngx-scrollbar copied to clipboard
updated event firing twice
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
As a workaround, I've added throttleTime(200) for now
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.