mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-06 06:01:31 -05:00
fix(client): remove focus event on Editor (#31591)
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user