From 4eb32fb0d96d2be3a21ec218b27a12a6ac282afc Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 14 Apr 2022 19:43:12 -0400 Subject: [PATCH] reusable public Utterance for a context response when constant size checkbox changes, see https://github.com/phetsims/gravity-force-lab-basics/issues/322 --- js/view/GFLBScreenView.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/view/GFLBScreenView.js b/js/view/GFLBScreenView.js index 7bc208c..f40bb2c 100644 --- a/js/view/GFLBScreenView.js +++ b/js/view/GFLBScreenView.js @@ -27,7 +27,7 @@ import ScreenView from '../../../joist/js/ScreenView.js'; import StringUtils from '../../../phetcommon/js/util/StringUtils.js'; import ModelViewTransform2 from '../../../phetcommon/js/view/ModelViewTransform2.js'; import ResetAllButton from '../../../scenery-phet/js/buttons/ResetAllButton.js'; -import { PDOMPeer } from '../../../scenery/js/imports.js'; +import { PDOMPeer, Voicing } from '../../../scenery/js/imports.js'; import { HBox } from '../../../scenery/js/imports.js'; import { Node } from '../../../scenery/js/imports.js'; import { Color } from '../../../scenery/js/imports.js'; @@ -366,6 +366,10 @@ class GFLBScreenView extends ScreenView { mass2Node ]; + // voicing - Make sure that the Utterances from Alerters only announce when the content under this ScreenView + // is visible + Voicing.registerUtteranceToNode( alertManager.constantSizeChangedContextResponseUtterance, this ); + // layout the view elements parameterControlPanel.right = this.layoutBounds.width - 15; parameterControlPanel.bottom = MASS_CONTROLS_Y_POSITION;