Fix FF/Win getting stuck on start game button

This commit is contained in:
Liam Westby 2019-10-09 11:21:54 -05:00
parent 5b2ba2b7e3
commit 20afe42efb
2 changed files with 7 additions and 1 deletions

View File

@ -27,5 +27,5 @@
</div>
<div id="footer" class="navbar">
<button type="button" (click)="gameButtonPressed()" [disabled]="gameButtonDisabled">{{gameButtonText}}</button>
<button id="gameButton" tabindex="0" type="button" (click)="gameButtonPressed()" [disabled]="gameButtonDisabled">{{gameButtonText}}</button>
</div>

View File

@ -57,6 +57,12 @@ export class GameComponent implements OnInit, OnDestroy {
}
case GameState.Playing: {
this.gameButtonText = 'Start Game';
// Firefox on Windows: focus gets stuck on the button if clicked,
// and no keyboard events are sent to the game. Remove the
// focus when the game starts.
document.getElementById('gameButton').blur();
this.gameButtonDisabled = true;
break;
}