Closed samreid closed 2 years ago
I just confirmed this is a problem for all Dialogs. I spent a few minutes investigating but I am not really sure how to fix this. Maybe the modalNodeStack
needs to be stateful? Assigning to the PhET-iO team.
@samreid and I did some exploration.
We learned:
Questions:
This was a regression caused by https://github.com/phetsims/axon/issues/409. @samreid and I were able to work it out. Basically, on dispose of a Dialog, we are calling isShowingProperty.value = false
, which the calles hidePopup
via a listener. This was no longer happening because of this code:
Because this Property is instrumented. The solution is to not consider dynamic element clearing (occurring on onBeforeSetState
as part of this.isSettingPhetioStateProperty: true
territory. Commits above. @marlitas would you like to spot check? Feel free to close.
Spot checked the commits, and all looks good to me. I'm not sure I'm fully following the order of things that caused the bug, but the explanation and fix seems reasonable. Closing!
Discovered in https://github.com/phetsims/circuit-construction-kit-common/issues/867. After closing the preferences dialog in the state wrapper, the downstream Preferences Dialog closes, but the semi-transparent overlay is still there.
@jessegreenberg can you please take a look?