Skip to content

Commit

Permalink
Set innertext
Browse files Browse the repository at this point in the history
  • Loading branch information
cayb0rg committed Aug 2, 2023
1 parent 505f699 commit 725947f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/controllers/ctl-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const shuffleArray = array => {
// helper function to update the aria-live status region
// angular binding does not cooperate well with aria-live, so we update the DOM element directly instead
export const assistiveAlert = ($scope, alert) => {
$scope.assistiveAlertText = alert
document.getElementById('assistive-alert').innerText = alert
}

export const getAllAnswerChoices = ($sce, _qset) => {
Expand Down Expand Up @@ -80,6 +80,8 @@ export const showNextQuestion = $scope => {
$scope.question.selected = false
$scope.question.transition = false
$scope.selectedChoice = -1

document.getElementById('questions-remaining').focus()
} else {
endGame($scope)
}
Expand Down
2 changes: 1 addition & 1 deletion src/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<!-- aria-live region to report status updates -->
<!-- note: browser support for aria-live is mixed, behavior may be inconsistent across browsers and devices -->
<div aria-live="assertive" role="status" id="assistive-alert" aria-atomic="true">{{assistiveAlertText}}</div>
<div aria-live="assertive" role="status" id="assistive-alert" aria-atomic="true"></div>
<main id="game" role="main">

<div id="splash" ng-class="{'raised': gameState.ingame}">
Expand Down

0 comments on commit 725947f

Please sign in to comment.