fix(client): remove focus event on Editor (#31591)

This commit is contained in:
Keith Holliday
2019-02-02 07:55:11 -07:00
committed by Valeriy
parent 4a27b23027
commit 457bd4de17

View File

@ -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 });