Skip to content

Commit

Permalink
Replace deprecated separator, see: phetsims/sun#805
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed Mar 7, 2023
1 parent f9c1373 commit 169df9f
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions js/create/view/TickMarkRangeComboBoxNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
import BooleanProperty from '../../../../axon/js/BooleanProperty.js';
import StringUtils from '../../../../phetcommon/js/util/StringUtils.js';
import PhetFont from '../../../../scenery-phet/js/PhetFont.js';
import { HBox, HBoxOptions, Node, RichText } from '../../../../scenery/js/imports.js';
import { HBox, HBoxOptions, HSeparator, Node, RichText } from '../../../../scenery/js/imports.js';
import ComboBox, { ComboBoxItem, ComboBoxOptions } from '../../../../sun/js/ComboBox.js';
import HSeparatorDeprecated from '../../../../sun/js/HSeparatorDeprecated.js';
import Tandem from '../../../../tandem/js/Tandem.js';
import ActivationUtterance from '../../../../utterance-queue/js/ActivationUtterance.js';
import TickMarkView from '../../common/view/TickMarkView.js';
Expand Down Expand Up @@ -60,13 +59,6 @@ class TickMarkRangeComboBoxNode extends HBox {
{ value: 30, createNode: () => new RichText( this.tickMarkRangeMap[ 30 ], RANGE_TEXT_OPTIONS ), a11yName: RatioAndProportionStrings.zeroToThirtyStringProperty }
];

const widestItem = Math.max( ...items.map( item => {
const node = item.createNode( Tandem.OPT_OUT );
const width = node.width;
node.dispose();
return width;
} ) );

const labelNode = new RichText( RatioAndProportionStrings.rangeStringProperty, RANGE_TEXT_OPTIONS );

const comboBoxOptions: ComboBoxOptions = {
Expand All @@ -90,7 +82,7 @@ class TickMarkRangeComboBoxNode extends HBox {
this.disabledComboBox = new ComboBox<true | number>( new BooleanProperty( value ) as Property<true | number>, [
{
value: value,
createNode: () => new HSeparatorDeprecated( widestItem, { centerY: -5 } ),
createNode: () => new HSeparator( { centerY: -5 } ),
a11yName: RatioAndProportionStrings.a11y.tickMark.tickMarksHiddenStringProperty
},
items[ 0 ] // add this one to get the proper height of the text.
Expand Down

0 comments on commit 169df9f

Please sign in to comment.