Fixes scrollIntoView when scrollbars are hidden
This commit is contained in:
parent
c2cfa99cc8
commit
c53b7aacfc
@ -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…
x
Reference in New Issue
Block a user