Skip to content

Commit

Permalink
support better alerts on non-safari browser/screen reader combos, phe…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 12, 2021
1 parent a146f5b commit 8104d51
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions js/AriaHerald.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import Emitter from '../../axon/js/Emitter.js';
import stepTimer from '../../axon/js/stepTimer.js';
import Enumeration from '../../phet-core/js/Enumeration.js';
import merge from '../../phet-core/js/merge.js';
import platform from '../../phet-core/js/platform.js';
import PDOMUtils from '../../scenery/js/accessibility/pdom/PDOMUtils.js';
import utteranceQueueNamespace from './utteranceQueueNamespace.js';

Expand Down Expand Up @@ -163,9 +164,15 @@ class AriaHerald {
// https://github.com/phetsims/scenery-phet/issues/491
stepTimer.setTimeout( () => {

// Using `hidden` rather than clearing textContent works better on mobile VO,
// see https://github.com/phetsims/scenery-phet/issues/490
liveElement.hidden = true;
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 = '';
}
}, 200 );
}, 0 );
}
Expand Down

0 comments on commit 8104d51

Please sign in to comment.