Missing dependency for DerivedProperty
Closed this issue · 2 comments
pixelzoom commented
Discovered in phetsims/axon#441 ...
Relevant code and fix in IdealGasLawContainer:
- this.isOpenProperty = new DerivedProperty( [ this.lidIsOnProperty, this.lidWidthProperty ],
+ this.isOpenProperty = new DerivedProperty( [ this.lidIsOnProperty, this.lidWidthProperty, this.boundsProperty ],
- ( lidIsOn, lidWidth ) => {
+ ( lidIsOn, lidWidth, bounds ) => {
return !lidIsOn || this.getOpeningWidth() !== 0;
} );
this.getOpeningWidth
calls this.getOpeningLeft
, which calls this.left
, which is a getter that uses this.boundsProperty
.
This needs to be tested before pushing.
pixelzoom commented
pixelzoom commented
Fixed in the above commit. Closing.