diff --git a/src/dat/gui/GUI.js b/src/dat/gui/GUI.js index 803ee1b..a327452 100644 --- a/src/dat/gui/GUI.js +++ b/src/dat/gui/GUI.js @@ -468,7 +468,7 @@ GUI.TEXT_CLOSED = 'Close Controls'; GUI.TEXT_OPEN = 'Open Controls'; GUI._keydownHandler = function(e) { - if (document.activeElement.type !== 'text' && + if (document.activeElement && document.activeElement.type !== 'text' && (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) { GUI.toggleHide(); }