Skip to content

Commit 6ac21cf

Browse files
committed
undo changes from #101 and fix the actual cause
1 parent 8a93bc5 commit 6ac21cf

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

Diff for: index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const scrollMonitor = new ScrollMonitorContainer(
1414
if (isInBrowser) {
1515
scrollMonitor.updateState();
1616
scrollMonitor.listenToDOM();
17+
//@ts-ignore
18+
window.scrollMonitor = scrollMonitor;
1719
}
18-
//@ts-ignore
19-
window.scrollMonitor = scrollMonitor;
2020

2121
export default scrollMonitor;

Diff for: src/container.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ function getViewportHeight(element: HTMLElement) {
66
if (isOnServer) {
77
return 0;
88
}
9-
if(typeof window !== 'undefined'){
10-
return window.innerHeight;
11-
}
129
if (element === document.body) {
13-
return document.documentElement.clientHeight;
10+
return window.innerHeight || document.documentElement.clientHeight;
1411
} else {
1512
return element.clientHeight;
1613
}

0 commit comments

Comments
 (0)