Skip to content

Commit ba93ed6

Browse files
Akira SudohChristopher A. Dhanaraj
Akira Sudoh
authored and
Christopher A. Dhanaraj
committed
fix(javascript): move away from scrollY IE doesn't support (#2428)
1 parent 029f122 commit ba93ed6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/detail-page-header/detail-page-header.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class DetailPageHeader extends mixin(createComponent, initComponentBySearch) {
2626
*/
2727
_handleScroll() {
2828
let scrollPosition;
29-
if (this.element.ownerDocument.defaultView.scrollY) {
30-
scrollPosition = this.element.ownerDocument.defaultView.scrollY;
29+
if (this.element.ownerDocument.defaultView.pageYOffset) {
30+
scrollPosition = this.element.ownerDocument.defaultView.pageYOffset;
3131
} else {
3232
scrollPosition = this.element.ownerDocument.defaultView.pageYOffset;
3333
}

src/globals/js/misc/menu-placement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function placeMenu(menu, menuContents, offset, direction) {
3232
const menuPosition = menu.getBoundingClientRect();
3333
const menuHeight = menuPosition.height;
3434
const menuWidth = menuPosition.width;
35-
const scroll = menu.ownerDocument.defaultView.scrollY;
35+
const scroll = menu.ownerDocument.defaultView.pageYOffset;
3636

3737
const menuContentsPosition = menuContents.getBoundingClientRect();
3838
const menuContentsHeight = menuContentsPosition.height;

0 commit comments

Comments
 (0)