diff --git a/.eslintrc b/.eslintrc index c352c0672..d3328d98e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -78,7 +78,7 @@ "no-path-concat": "error", "no-redeclare": "error", "no-regex-spaces": "error", - "no-restricted-globals": ["error", "Debug", "document", "Document" "event", "history", "History", "length", "Map", "Node", "parent", "Range", "Selection", "Set", "Text"], + "no-restricted-globals": ["error", "Debug", "document", "Document", "event", "history", "History", "length", "Map", "Node", "parent", "Range", "Selection", "Set", "Text"], "no-sequences": "error", "no-shadow": "error", "no-shadow-restricted-names": "error", diff --git a/examples/hovering-menu/index.js b/examples/hovering-menu/index.js index 1c67c8390..267b320e6 100644 --- a/examples/hovering-menu/index.js +++ b/examples/hovering-menu/index.js @@ -6,7 +6,7 @@ import React from 'react' import ReactDOM from 'react-dom' import initialState from './state.json' -const root = document.querySelector('main') +const root = window.document.querySelector('main') /** * Define a schema. diff --git a/packages/slate-react/src/constants/environment.js b/packages/slate-react/src/constants/environment.js index 0c9b07664..13bc4638b 100644 --- a/packages/slate-react/src/constants/environment.js +++ b/packages/slate-react/src/constants/environment.js @@ -75,7 +75,7 @@ if (browser) { } } - const testEl = document.createElement('div') + const testEl = window.document.createElement('div') testEl.contentEditable = true for (let i = 0; i < EVENT_RULES.length; i++) {