phetsims / sun

User-interface components for PhET simulations, built on top of Scenery.
MIT License
4 stars 12 forks source link

Dialog: Assertion failed: This node is already managed by a layout container #761

Closed zepumph closed 2 years ago

zepumph commented 2 years ago

This is a new assertion added from layout changes by @jonathanolson. Full assertion:

Assertion failed: This node is already managed by a layout container - make sure to wrap it in a Node if DAG, removing it from an old layout container, etc

Here is the failing line of code:

https://github.com/phetsims/sun/blob/872f33b097e1195c719f42af189c37050857bd6d/js/Dialog.js#L250

We should just be able to dispose this VBox to accomplish the bug fix.

To reproduce the bug, go to the state wrapper in ratio and proportion, and open the keyboard help dialog. Upon 2 set states, it will fail.

zepumph commented 2 years ago

This fixed the error in my testing. I'll wait to close until I confirm on CT.

zepumph commented 2 years ago

The above issues are in fact this problem, just a downstream error from this assertion. When the DAG assertion triggers, it doesn't dispose the close button, so it recreates it again after startup and fails the phet-io API checker.