diff --git a/js/beerslaw/view/SolutionControl.ts b/js/beerslaw/view/SolutionControl.ts index 6b809a62..e73f6e11 100644 --- a/js/beerslaw/view/SolutionControl.ts +++ b/js/beerslaw/view/SolutionControl.ts @@ -89,7 +89,15 @@ function createItem( solution: BeersLawSolution ): ComboBoxItem ( formula === null || formula === '' ) ? name : StringUtils.format( pattern, formula, name ) + ( pattern, name, formula ) => { + if ( formula === null || formula === '' ) { + return name; // if there is no formula, default to the solution name + } + else { + // See https://github.com/phetsims/beers-law-lab/issues/326 for StringUtils.wrapLTR + return StringUtils.format( pattern, StringUtils.wrapLTR( formula ), name ); + } + } ); const labelText = new RichText( labelStringProperty, { diff --git a/js/concentration/view/ConcentrationScreenView.ts b/js/concentration/view/ConcentrationScreenView.ts index 04b6e7d1..2aca10d2 100644 --- a/js/concentration/view/ConcentrationScreenView.ts +++ b/js/concentration/view/ConcentrationScreenView.ts @@ -35,6 +35,7 @@ import SolutionVolumeNode from './SolutionVolumeNode.js'; import Tandem from '../../../../tandem/js/Tandem.js'; import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; import StringIO from '../../../../tandem/js/types/StringIO.js'; +import StringUtils from '../../../../phetcommon/js/util/StringUtils.js'; export default class ConcentrationScreenView extends ScreenView { @@ -79,7 +80,7 @@ export default class ConcentrationScreenView extends ScreenView { const solute = model.shaker.soluteProperty.value; const formula = solute.formulaProperty.value; const name = solute.nameProperty.value; - return formula ? formula : name; + return formula ? StringUtils.wrapLTR( formula ) : name; }, { tandem: tandem.createTandem( 'soluteLabelStringProperty' ), phetioValueType: StringIO,