From 457bd4de171e8e47e0f344cd7e8722b1c433758b Mon Sep 17 00:00:00 2001 From: Keith Holliday Date: Sat, 2 Feb 2019 07:55:11 -0700 Subject: [PATCH] fix(client): remove focus event on Editor (#31591) --- client/src/templates/Challenges/classic/Editor.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/client/src/templates/Challenges/classic/Editor.js b/client/src/templates/Challenges/classic/Editor.js index b384c4251b..b9d8fd1eda 100644 --- a/client/src/templates/Challenges/classic/Editor.js +++ b/client/src/templates/Challenges/classic/Editor.js @@ -85,10 +85,6 @@ class Editor extends Component { this._editor = null; } - componentWillUnmount() { - document.removeEventListener('keyup', this.focusEditor); - } - editorWillMount = monaco => { defineMonacoThemes(monaco); }; @@ -96,7 +92,6 @@ class Editor extends Component { editorDidMount = (editor, monaco) => { this._editor = editor; this._editor.focus(); - document.addEventListener('keyup', this.focusEditor); this._editor.addAction({ id: 'execute-challenge', label: 'Run tests', @@ -108,13 +103,6 @@ class Editor extends Component { }); }; - focusEditor = e => { - // e key to focus editor - if (e.keyCode === 69) { - this._editor.focus(); - } - }; - onChange = editorValue => { const { updateFile, fileKey } = this.props; updateFile({ key: fileKey, editorValue });