Skip to content

Commit

Permalink
better check for voicing + assertion, phetsims/ratio-and-proportion#509
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 7, 2022
1 parent 7f6ba85 commit 75da680
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/Sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,10 @@ export default class Sim extends PhetioObject {
} );
this.display.simulationRoot.addChild( this.navigationBar );

if ( this.toolbar ) {
this.display.simulationRoot.addChild( this.toolbar );
this.display.simulationRoot.pdomOrder = [ this.toolbar ];
if ( this.preferencesModel.audioModel.supportsVoicing ) {
assert && assert( this.toolbar, 'toolbar should exist for voicing' );
this.display.simulationRoot.addChild( this.toolbar! );
this.display.simulationRoot.pdomOrder = [ this.toolbar! ];

// If Voicing is not "fully" enabled, only the toolbar is able to produce Voicing output.
// All other simulation components should not voice anything. This must be called only after
Expand Down

0 comments on commit 75da680

Please sign in to comment.