Skip to content

Commit

Permalink
add voicing to checkbox, #742
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 24, 2022
1 parent 5205eb7 commit aee043c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/Checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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: [],
Expand Down

0 comments on commit aee043c

Please sign in to comment.