From 1427bd4b0eca781f190e99f7cd322bb01d54e455 Mon Sep 17 00:00:00 2001 From: Sam Reid Date: Wed, 2 Oct 2024 08:31:56 -0600 Subject: [PATCH] Add maxWidth for gravity and fluid fallback text, see https://github.com/phetsims/density-buoyancy-common/issues/394 and https://github.com/phetsims/density-buoyancy-common/issues/418 --- js/common/view/FluidDensityControlNode.ts | 5 ++++- js/common/view/GravityControlNode.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/common/view/FluidDensityControlNode.ts b/js/common/view/FluidDensityControlNode.ts index cf747f12..7816e556 100644 --- a/js/common/view/FluidDensityControlNode.ts +++ b/js/common/view/FluidDensityControlNode.ts @@ -33,7 +33,10 @@ type ParentOptions = WithRequired>, type DensityControlNodeOptions = SelfOptions & ParentOptions; const FALLBACK_NODE = new Text( DensityBuoyancyCommonStrings.whatIsTheFluidDensityStringProperty, { - font: new PhetFont( 14 ) + font: new PhetFont( 14 ), + + // estimate as the same max width as the combo box below + maxWidth: 210 } ); export default class FluidDensityControlNode extends ComboNumberControl { diff --git a/js/common/view/GravityControlNode.ts b/js/common/view/GravityControlNode.ts index cdc2daee..767a9f2e 100644 --- a/js/common/view/GravityControlNode.ts +++ b/js/common/view/GravityControlNode.ts @@ -18,7 +18,10 @@ import GravityProperty from '../model/GravityProperty.js'; import ComboNumberControl from './ComboNumberControl.js'; const FALLBACK_NODE = new Text( DensityBuoyancyCommonStrings.whatIsTheValueOfGravityStringProperty, { - font: new PhetFont( 14 ) + font: new PhetFont( 14 ), + + // estimate as the same max width as the combo box below + maxWidth: 210 } ); export default class GravityControlNode extends ComboNumberControl {