Skip to content

Commit

Permalink
fix: sidebar navigation issues when scrollYOffset is float number
Browse files Browse the repository at this point in the history
fixes #748
  • Loading branch information
RomanHotsiy committed Jan 17, 2019
1 parent 02f6e18 commit c04f387
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/ScrollService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export class ScrollService {
}
element.scrollIntoView();
if (this._scrollParent && this._scrollParent.scrollBy) {
(this._scrollParent.scrollBy as any)(0, -this.options.scrollYOffset());
// adding 1 account rounding errors in case scrollYOffset is float-number
(this._scrollParent.scrollBy as any)(0, -this.options.scrollYOffset() + 1);
}
}

Expand Down

0 comments on commit c04f387

Please sign in to comment.