From ddf55df87d6f2022889d408a058d4e629b4fdb0c Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 23 May 2024 14:14:12 -0400 Subject: [PATCH] Revert "testing out a change for https://github.com/phetsims/utterance-queue/issues/117" This reverts commit e2ed603553543b930467737a48c9fa481d0788b2. --- js/AriaLiveAnnouncer.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/js/AriaLiveAnnouncer.ts b/js/AriaLiveAnnouncer.ts index ffd5867..942e789 100644 --- a/js/AriaLiveAnnouncer.ts +++ b/js/AriaLiveAnnouncer.ts @@ -30,6 +30,7 @@ import stepTimer from '../../axon/js/stepTimer.js'; import Enumeration from '../../phet-core/js/Enumeration.js'; import EnumerationValue from '../../phet-core/js/EnumerationValue.js'; import optionize from '../../phet-core/js/optionize.js'; +import platform from '../../phet-core/js/platform.js'; import { PDOMUtils } from '../../scenery/js/imports.js'; import Announcer, { AnnouncerAnnounceOptions, AnnouncerOptions } from './Announcer.js'; import Utterance from './Utterance.js'; @@ -230,18 +231,15 @@ class AriaLiveAnnouncer extends Announcer { // https://github.com/phetsims/scenery-phet/issues/491 stepTimer.setTimeout( () => { - // if ( platform.safari ) { - // - // // Using `hidden` rather than clearing textContent works better on mobile VO, - // // see https://github.com/phetsims/scenery-phet/issues/490 - // liveElement.hidden = true; - // } - // else { - // liveElement.textContent = ''; - // } - - // TODO: testing out this change to see if it fixes a VoiceOver problem, see https://github.com/phetsims/utterance-queue/issues/117 - liveElement.textContent = ''; + if ( platform.safari ) { + + // Using `hidden` rather than clearing textContent works better on mobile VO, + // see https://github.com/phetsims/scenery-phet/issues/490 + liveElement.hidden = true; + } + else { + liveElement.textContent = ''; + } // Wait until after this timeout to let the UtteranceQueue can announce Utterances again. This delay // seems to be necessary to force VoiceOver to speak aria-live alerts in first-in-first-out order.