Skip to content

Commit f387cca

Browse files
committed
Fix for SSR;
1 parent c7066fc commit f387cca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/util/getScrollbarWidth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exports.dbgSetScrollbarWidth = dbgSetScrollbarWidth;
88
exports.dbgSetDocument = dbgSetDocument;
99
exports.dbgGetDocument = dbgGetDocument;
1010
var scrollbarWidth = null;
11-
var doc = document;
11+
var doc = typeof document !== "undefined" ? document : null;
1212
/**
1313
* @description Returns scrollbar width specific for current environment
1414
* @return {number}

src/util/getScrollbarWidth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let scrollbarWidth = null;
2-
let doc = document;
2+
let doc = typeof document !== "undefined" ? document : null;
33

44
/**
55
* @description Returns scrollbar width specific for current environment

0 commit comments

Comments
 (0)