mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 23:58:07 +02:00
Fix bug in scrollIntoView
Prior to this commit, if the vertical scroll bar is absent and the horizontal scroll bar is present, a link to a particular point on the page which should induce a horizontal scroll did not do so, because the absence of a vertical scroll bar meant that the viewer was not recognized as the nearest scrolling ancestor. This commit adds a check for horizontal scroll bars when searching for the scrolling ancestor.
This commit is contained in:
parent
c5c06bf5c4
commit
65c8549759
1 changed files with 2 additions and 1 deletions
|
@ -115,7 +115,8 @@ function scrollIntoView(element, spot, skipOverflowHiddenElements = false) {
|
|||
}
|
||||
let offsetY = element.offsetTop + element.clientTop;
|
||||
let offsetX = element.offsetLeft + element.clientLeft;
|
||||
while (parent.clientHeight === parent.scrollHeight ||
|
||||
while ((parent.clientHeight === parent.scrollHeight &&
|
||||
parent.clientWidth === parent.scrollWidth) ||
|
||||
(skipOverflowHiddenElements &&
|
||||
getComputedStyle(parent).overflow === 'hidden')) {
|
||||
if (parent.dataset._scaleY) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue