Skip to content

Commit

Permalink
convert ComboBoxItem from class to type, phetsims/sun#768
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Jun 27, 2022
1 parent 3ba9657 commit 1d0e30c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions js/common/view/SoluteComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@

import merge from '../../../../phet-core/js/merge.js';
import PhetFont from '../../../../scenery-phet/js/PhetFont.js';
import { HBox } from '../../../../scenery/js/imports.js';
import { Rectangle } from '../../../../scenery/js/imports.js';
import { Text } from '../../../../scenery/js/imports.js';
import { HBox, Rectangle, Text } from '../../../../scenery/js/imports.js';
import ComboBox from '../../../../sun/js/ComboBox.js';
import ComboBoxItem from '../../../../sun/js/ComboBoxItem.js';
import Tandem from '../../../../tandem/js/Tandem.js';
import phScale from '../../phScale.js';

Expand Down Expand Up @@ -70,9 +67,11 @@ class SoluteComboBox extends ComboBox {
children: [ colorNode, textNode ]
} );

items.push( new ComboBoxItem( hBox, solute, {
tandemName: `${solute.tandemName}Item` // Item suffix is required by ComboBoxItem
} ) );
items.push( {
value: solute,
node: hBox,
tandemName: `${solute.tandemName}${ComboBox.ITEM_TANDEM_NAME_SUFFIX}`
} );
} );

// ComboBox does not dynamically resize. So if a solution name does change, constrain the listbox item width.
Expand Down

0 comments on commit 1d0e30c

Please sign in to comment.