Skip to content

Commit c53b7aa

Browse files
committed
Fixes scrollIntoView when scrollbars are hidden
1 parent c2cfa99 commit c53b7aa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

web/viewer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ function scrollIntoView(element, spot) {
3838
while (parent.clientHeight == parent.scrollHeight) {
3939
offsetY += parent.offsetTop;
4040
parent = parent.offsetParent;
41+
if (!parent)
42+
return; // no need to scroll
4143
}
4244
if (spot)
4345
offsetY += spot.top;

0 commit comments

Comments
 (0)