From aee043c41128c37d0afd851ac43c6292e5799d96 Mon Sep 17 00:00:00 2001 From: zepumph Date: Wed, 23 Feb 2022 17:01:08 -0700 Subject: [PATCH] add voicing to checkbox, https://github.com/phetsims/sun/issues/742 --- js/Checkbox.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/Checkbox.js b/js/Checkbox.js index 730ddd0c..0c345c82 100644 --- a/js/Checkbox.js +++ b/js/Checkbox.js @@ -81,7 +81,8 @@ class Checkbox extends Voicing( Node, 0 ) { inputType: 'checkbox', appendDescription: true, - // {TAlertableDef|null} - Utterances to be spoken with a screen reader after the checkbox is pressed. + // {TAlertableDef|null} - Utterances to be spoken with a screen reader after the checkbox is pressed. Also used for + // the voicingContextResponse checkedContextResponse: null, uncheckedContextResponse: null }, options ); @@ -95,10 +96,12 @@ class Checkbox extends Voicing( Node, 0 ) { if ( property.value ) { options.checkedSoundPlayer.play(); options.checkedContextResponse && this.alertDescriptionUtterance( options.checkedContextResponse ); + this.voicingSpeakNameResponse( { contextResponse: options.checkedContextResponse } ); } else { options.uncheckedSoundPlayer.play(); options.uncheckedContextResponse && this.alertDescriptionUtterance( options.uncheckedContextResponse ); + this.voicingSpeakNameResponse( { contextResponse: options.uncheckedContextResponse } ); } }, { parameters: [],