fix: sidebar navigation issues when scrollYOffset is float number

fixes #748
This commit is contained in:
Roman Hotsiy 2019-01-17 12:19:55 +02:00
parent 02f6e1820b
commit c04f387378
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -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);
}
}