We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a93bc5 commit 6ac21cfCopy full SHA for 6ac21cf
index.ts
@@ -14,8 +14,8 @@ const scrollMonitor = new ScrollMonitorContainer(
14
if (isInBrowser) {
15
scrollMonitor.updateState();
16
scrollMonitor.listenToDOM();
17
+ //@ts-ignore
18
+ window.scrollMonitor = scrollMonitor;
19
}
-//@ts-ignore
-window.scrollMonitor = scrollMonitor;
20
21
export default scrollMonitor;
src/container.ts
@@ -6,11 +6,8 @@ function getViewportHeight(element: HTMLElement) {
6
if (isOnServer) {
7
return 0;
8
9
- if(typeof window !== 'undefined'){
10
- return window.innerHeight;
11
- }
12
if (element === document.body) {
13
- return document.documentElement.clientHeight;
+ return window.innerHeight || document.documentElement.clientHeight;
} else {
return element.clientHeight;
0 commit comments