Skip to content
This repository was archived by the owner on Dec 7, 2022. It is now read-only.

Commit 7c0531f

Browse files
author
Alice
committed
Merge pull request #72 from alice/scrollArea
Check for body element in axs.utils.canScrollTo()
2 parents 96052e4 + d7094b3 commit 7c0531f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/js/AccessibilityUtils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,10 @@ axs.utils.canScrollTo = function(element, container) {
173173
var defaultView = element.ownerDocument.defaultView;
174174
var style = defaultView.getComputedStyle(container);
175175

176-
if (rect.left > containerRect.right || rect.top > containerRect.bottom)
177-
return (style.overflow == 'scroll' || style.overflow == 'auto');
176+
if (rect.left > containerRect.right || rect.top > containerRect.bottom) {
177+
return (style.overflow == 'scroll' || style.overflow == 'auto' ||
178+
container instanceof defaultView.HTMLBodyElement);
179+
}
178180

179181
return true;
180182
};

0 commit comments

Comments
 (0)