Skip to content

Commit

Permalink
remove utterances from the queue in cancelUtterance, see #68
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Mar 13, 2022
1 parent bee6411 commit b2b4251
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/UtteranceQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,10 @@ class UtteranceQueue extends PhetioObject {
*/
cancelUtterance( utterance: Utterance ): void {
this.announcer.cancelUtterance( utterance );

if ( this.hasUtterance( utterance ) ) {
this.removeUtterance( utterance );
}
}

/**
Expand Down

0 comments on commit b2b4251

Please sign in to comment.