fix: focus on HotKeys by default

This commit is contained in:
Oliver Eyton-Williams
2019-09-19 11:17:06 +02:00
committed by mrugesh
parent 023df09289
commit 465f206a9d
2 changed files with 4 additions and 0 deletions

View File

@ -105,6 +105,7 @@ export class BackEnd extends Component {
componentDidMount() {
this.initializeComponent();
window.addEventListener('resize', this.updateDimensions);
this._container.focus();
}
updateDimensions() {
@ -186,6 +187,7 @@ export class BackEnd extends Component {
return (
<Hotkeys
innerRef={c => (this._container = c)}
introPath={introPath}
nextChallengePath={nextChallengePath}
prevChallengePath={prevChallengePath}

View File

@ -63,6 +63,7 @@ export class Project extends Component {
} = this.props;
updateChallengeMeta({ ...challengeMeta, title, challengeType });
challengeMounted(challengeMeta.id);
this._container.focus();
}
componentDidUpdate(prevProps) {
@ -111,6 +112,7 @@ export class Project extends Component {
const blockNameTitle = `${blockName} - ${title}`;
return (
<Hotkeys
innerRef={c => (this._container = c)}
introPath={introPath}
nextChallengePath={nextChallengePath}
prevChallengePath={prevChallengePath}