Skip to content

Commit

Permalink
#1646: Fix SSR rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-m1 committed Sep 27, 2019
1 parent 9fd5769 commit 5fccf71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @license MIT
*/

import './windowCheck.js'; // Always import first

import { version } from '../package.json';

import { IE11OrLess, Edge, FireFox, Safari, IOS, ChromeForAndroid } from './BrowserInfo.js';
Expand Down Expand Up @@ -92,10 +94,6 @@ function _dispatchEvent(info) {
}


if (typeof window === "undefined" || !window.document) {
throw new Error("Sortable.js requires a window with a document");
}

let dragEl,
parentEl,
ghostEl,
Expand Down
3 changes: 3 additions & 0 deletions src/windowCheck.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if (typeof window === "undefined" || !window.document) {
throw new Error("Sortable.js requires a window with a document");
}

0 comments on commit 5fccf71

Please sign in to comment.