From f03d623c3d55cfa7552f0aac08f5efa7c3f23cae Mon Sep 17 00:00:00 2001 From: Michael Kauzmann Date: Fri, 13 Dec 2024 16:00:46 -0700 Subject: [PATCH] updates to FireListener instrumentation, https://github.com/phetsims/scenery/issues/1676 --- js/AquaRadioButton.ts | 4 +++- js/Checkbox.ts | 3 ++- js/MenuItem.ts | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/js/AquaRadioButton.ts b/js/AquaRadioButton.ts index f87e5ced..ebc84419 100644 --- a/js/AquaRadioButton.ts +++ b/js/AquaRadioButton.ts @@ -187,7 +187,9 @@ export default class AquaRadioButton extends WidthSizable( Voicing( Node ) ) }; const fireListener = new FireListener( { fire: fire, - tandem: options.tandem.createTandem( 'fireListener' ) + + // Purposefully no nesting here, because we want the firedEmitter at the top level, and we don't instrument the enabledProperty + tandem: options.tandem } ); this.addInputListener( fireListener ); diff --git a/js/Checkbox.ts b/js/Checkbox.ts index a5128cd8..d7afa6b8 100644 --- a/js/Checkbox.ts +++ b/js/Checkbox.ts @@ -203,7 +203,8 @@ export default class Checkbox extends WidthSizable( Voicing( Node ) ) { } }, - tandem: options.tandem.createTandem( 'fireListener' ) + // Purposefully no nesting here, because we want the firedEmitter at the top level, and we don't instrument the enabledProperty + tandem: options.tandem } ); this.addInputListener( fireListener ); diff --git a/js/MenuItem.ts b/js/MenuItem.ts index cbb5c65e..c6df25f8 100644 --- a/js/MenuItem.ts +++ b/js/MenuItem.ts @@ -151,7 +151,9 @@ export default class MenuItem extends WidthSizable( Voicing( Node ) ) { } ); this.addInputListener( new FireListener( { - tandem: options.tandem?.createTandem( 'fireListener' ), + + // Purposefully no nesting here, because we want the firedEmitter at the top level, and we don't instrument the enabledProperty + tandem: options.tandem, fire: ( event: SceneryEvent ) => { closeCallback( event ); callback( event );