phetsims / bending-light

"Bending Light" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/bending-light
GNU General Public License v3.0
8 stars 8 forks source link

TS2345: missing required options to WavelengthSlider. #405

Closed pixelzoom closed 2 years ago

pixelzoom commented 2 years ago

After converting scenery-phet.WavelengthSlider to TypeScript, bending-light is failing in WavelengthControl.ts. See screenshot below.

The hierarchy for WavelengthSlider is as follows:

2 options required by AccessibleValueHandlerSelfOptions are missing: valueProperty and enabledRangeProperty. Based on these assertion in AccessibleValueHandler, I'm not sure how this was working previously:

256      assert && assert( providedOptions.enabledRangeProperty, 'enabledRangeProperty is a required option' );
257      assert && assert( providedOptions.valueProperty, 'valueProperty is a required option' );

The missing valueProperty can be addressed by adding valueProperty: wavelengthProperty. But I don't know how to address enabledRangeProperty.

Assigning to @samreid, the responsible dev for this sim.

screenshot_1639
samreid commented 2 years ago

@chrisklus and I collaborated on the above solution. @pixelzoom would you like to review?

We tested in Bending Light as well as Models of the Hydrogen Atom.

pixelzoom commented 2 years ago

👍🏻