From 465f206a9ddb40d5a7d4f539334a6a4537b1ba63 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Thu, 19 Sep 2019 11:17:06 +0200 Subject: [PATCH] fix: focus on HotKeys by default --- client/src/templates/Challenges/projects/backend/Show.js | 2 ++ client/src/templates/Challenges/projects/frontend/Show.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/client/src/templates/Challenges/projects/backend/Show.js b/client/src/templates/Challenges/projects/backend/Show.js index 3f08c18cf0..f856516bd9 100644 --- a/client/src/templates/Challenges/projects/backend/Show.js +++ b/client/src/templates/Challenges/projects/backend/Show.js @@ -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 ( (this._container = c)} introPath={introPath} nextChallengePath={nextChallengePath} prevChallengePath={prevChallengePath} diff --git a/client/src/templates/Challenges/projects/frontend/Show.js b/client/src/templates/Challenges/projects/frontend/Show.js index aa145355b3..3195b5ccbf 100644 --- a/client/src/templates/Challenges/projects/frontend/Show.js +++ b/client/src/templates/Challenges/projects/frontend/Show.js @@ -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 ( (this._container = c)} introPath={introPath} nextChallengePath={nextChallengePath} prevChallengePath={prevChallengePath}