mirror of
https://github.com/OpenLiberty/liberty-bikes.git
synced 2024-11-21 00:51:27 +08:00
Fix FF/Win getting stuck on start game button
This commit is contained in:
parent
5b2ba2b7e3
commit
20afe42efb
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user