Here is an example of a working combobox.
I created it in example-sim. You can get example-sim by cloning it:
I went to MagnetsScreenView.js of the example-sim and deleted the previous content and added the following.
```
// Copyright 2021, University of Colorado Boulder
/**
* MagnetsScreenView is the top-level view component for the 'Magnets' screen. All of the components that make up
* the screen's view are added here.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Sam Reid (PhET Interactive Simulations)
* @author Steele Dalton (PhET Interactive Simulations)
*/
import Property from '../../../../axon/js/Property.js';
import ScreenView from '../../../../joist/js/ScreenView.js';
import { Node, Text } from '../../../../scenery/js/imports.js';
import ComboBox from '../../../../sun/js/ComboBox.js';
import exampleSim from '../../exampleSim.js';
class MagnetsScreenView extends ScreenView {
/**
* @param {MagnetsModel} model - the top-level model for this screen
*/
constructor( model ) {
super();
const values = [ 'one', 'two', 'three', 'four', 'five', 'six' ];
const items = [];
values.forEach( value => {
items.push( {
value: value,
node: new Text( value )
} );
} );
const selectedItemProperty = new Property( values[ 0 ] );
const listParent = new Node();
const comboBox = new ComboBox( selectedItemProperty, items, listParent, {
highlightFill: 'yellow',
listPosition: 'below'
} );
this.addChild( comboBox );
this.addChild( listParent );
}
}
exampleSim.register( 'MagnetsScreenView', MagnetsScreenView );
export default MagnetsScreenView;
```