From 098053977d686e01d3f607c3e9483eb6c12dc1c0 Mon Sep 17 00:00:00 2001 From: arusak Date: Mon, 20 Nov 2017 20:00:43 +0300 Subject: [PATCH] Fix zefoy/ngx-perfect-scrollbar#118 premature animation stop --- src/lib/perfect-scrollbar.directive.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/perfect-scrollbar.directive.ts b/src/lib/perfect-scrollbar.directive.ts index 43d4224..1df1309 100644 --- a/src/lib/perfect-scrollbar.directive.ts +++ b/src/lib/perfect-scrollbar.directive.ts @@ -300,7 +300,9 @@ export class PerfectScrollbarDirective implements OnDestroy, DoCheck, OnChanges, if (scrollCount >= Math.PI) { this.animateScrolling(target, value, 0); } else { - this.elementRef.nativeElement[target] = oldValue = newValue; + this.elementRef.nativeElement[target] = newValue; + // On a zoomed out page in Chrome the resulting offset may differ from the specified value + oldValue = this.elementRef.nativeElement[target]; this.ps.update();