From 84e31e5327e5b9ac1b9db8ad85eff1fabccd5a7d Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 18 Mar 2021 15:21:12 -0400 Subject: [PATCH] use stepTimer instead of window.setTimeout, see phetsims/phet-info#59 --- js/accessibility/speaker/webSpeaker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/accessibility/speaker/webSpeaker.js b/js/accessibility/speaker/webSpeaker.js index 42829d10a..ac508ef31 100644 --- a/js/accessibility/speaker/webSpeaker.js +++ b/js/accessibility/speaker/webSpeaker.js @@ -14,6 +14,7 @@ import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; import Emitter from '../../../../axon/js/Emitter.js'; import NumberProperty from '../../../../axon/js/NumberProperty.js'; import Property from '../../../../axon/js/Property.js'; +import stepTimer from '../../../../axon/js/stepTimer.js'; import Range from '../../../../dot/js/Range.js'; import platform from '../../../../phet-core/js/platform.js'; import stripEmbeddingMarks from '../../../../phet-core/js/stripEmbeddingMarks.js'; @@ -207,7 +208,7 @@ class WebSpeaker { // on safari, giving a bit of a delay to the speak request makes the `end` // SpeechSynthesisUtterance event come through much more consistently if ( platform.safari ) { - window.setTimeout( () => { + stepTimer.setTimeout( () => { this.synth.speak( speechSynthUtterance ); }, 500 ); }