Skip to content

Commit

Permalink
proposed fix for #846
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Aug 29, 2022
1 parent 63a8097 commit 5f37d77
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/toolbar/VoicingToolbarItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,15 @@ class LabelButtonRow {
if ( endedUtterance === this.objectResponseUtterance ) {
this.playingProperty.set( false );

// clear the voicingUtteranceQueue because stale alerts may have collected while the quick info button announced
voicingUtteranceQueue.clear();

// Remove if listener wasn't interrupted by Display input.
if ( Display.inputListeners.includes( displayListener ) ) {
Display.removeInputListener( displayListener );

// Stale alerts may be in the queue waiting for the toolbar button content to finish. Only clear if we did not
// receive an interruption event because we need to hear responses related to the users interaction
// which is likely still in the queue. Note that means that the queue is not cleared if the user taps the
// screen without interacting with something but I (@jessegreenberg) think that is acceptable.
voicingUtteranceQueue.clear();
}
}
} );
Expand Down

0 comments on commit 5f37d77

Please sign in to comment.