mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Fixes scrollIntoView when scrollbars are hidden
This commit is contained in:
parent
c2cfa99cc8
commit
c53b7aacfc
1 changed files with 2 additions and 0 deletions
|
@ -38,6 +38,8 @@ function scrollIntoView(element, spot) {
|
||||||
while (parent.clientHeight == parent.scrollHeight) {
|
while (parent.clientHeight == parent.scrollHeight) {
|
||||||
offsetY += parent.offsetTop;
|
offsetY += parent.offsetTop;
|
||||||
parent = parent.offsetParent;
|
parent = parent.offsetParent;
|
||||||
|
if (!parent)
|
||||||
|
return; // no need to scroll
|
||||||
}
|
}
|
||||||
if (spot)
|
if (spot)
|
||||||
offsetY += spot.top;
|
offsetY += spot.top;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue