Skip to content

Commit

Permalink
Merge pull request #119 from arusak/animate-zoomed
Browse files Browse the repository at this point in the history
Fixes #118 premature animation stop in some situations
  • Loading branch information
sconix authored Nov 21, 2017
2 parents f9288d9 + 0980539 commit aa119fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/perfect-scrollbar.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit aa119fc

Please sign in to comment.