Skip to content

Commit

Permalink
fix DAG problems with dynamic element dialogs, phetsims/joist#821
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jul 8, 2022
1 parent 71fa952 commit d53efa3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/micro/view/MicroScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import ModelViewTransform2 from '../../../../phetcommon/js/view/ModelViewTransfo
import ResetAllButton from '../../../../scenery-phet/js/buttons/ResetAllButton.js';
import PhetFont from '../../../../scenery-phet/js/PhetFont.js';
import TimeControlNode from '../../../../scenery-phet/js/TimeControlNode.js';
import { AriaHasPopUpMutator, globalKeyStateTracker, KeyboardUtils, Rectangle, Text } from '../../../../scenery/js/imports.js';
import { AriaHasPopUpMutator, globalKeyStateTracker, KeyboardUtils, Node, Rectangle, Text } from '../../../../scenery/js/imports.js';
import RectangularPushButton from '../../../../sun/js/buttons/RectangularPushButton.js';
import Dialog from '../../../../sun/js/Dialog.js';
import nullSoundPlayer from '../../../../tambo/js/shared-sound-players/nullSoundPlayer.js';
Expand Down Expand Up @@ -173,7 +173,9 @@ class MicroScreenView extends ScreenView {
const spectrumButtonLabel = new SpectrumDiagram( tandem.createTandem( 'spectrumButtonLabel' ) );

const lightSpectrumDialogCapsule = new PhetioCapsule( tandem => {
return new LightSpectrumDialog( spectrumButtonLabel, tandem );

// Wrap in a node to prevent DAG problems if archetypes are also created
return new LightSpectrumDialog( new Node( { children: [ spectrumButtonLabel ] } ), tandem );
}, [], {
tandem: tandem.createTandem( 'lightSpectrumDialogCapsule' ),
phetioType: PhetioCapsule.PhetioCapsuleIO( Dialog.DialogIO )
Expand Down

0 comments on commit d53efa3

Please sign in to comment.