Skip to content

Commit

Permalink
opt out of most PressListener instrumentations (there are better ways),
Browse files Browse the repository at this point in the history
zepumph committed Jan 10, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 0b8a540 commit 92314e0
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/JoistButton.ts
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ import { Color, Node, NodeOptions, PressListener, SceneryConstants, Voicing, Voi
import ButtonInteractionState from '../../sun/js/buttons/ButtonInteractionState.js';
import PushButtonInteractionStateProperty from '../../sun/js/buttons/PushButtonInteractionStateProperty.js';
import PushButtonModel from '../../sun/js/buttons/PushButtonModel.js';
import Tandem from '../../tandem/js/Tandem.js';
import HighlightNode from './HighlightNode.js';
import joist from './joist.js';

@@ -115,7 +116,7 @@ export default class JoistButton extends Voicing( Node ) {

// Hook up the input listener
this._pressListener = this.buttonModel.createPressListener( {
tandem: options.tandem.createTandem( 'pressListener' )
tandem: Tandem.OPT_OUT // PushButtonModel provides a firedEmitter which is sufficient
} );
this.addInputListener( this._pressListener );

3 changes: 2 additions & 1 deletion js/NavigationBarScreenButton.ts
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ import PhetColorScheme from '../../scenery-phet/js/PhetColorScheme.js';
import PhetFont from '../../scenery-phet/js/PhetFont.js';
import { Color, Node, NodeOptions, Rectangle, Text, VBox, Voicing, VoicingOptions } from '../../scenery/js/imports.js';
import PushButtonModel from '../../sun/js/buttons/PushButtonModel.js';
import Tandem from '../../tandem/js/Tandem.js';
import HighlightNode from './HighlightNode.js';
import joist from './joist.js';
import { AnyScreen } from './Screen.js';
@@ -145,7 +146,7 @@ class NavigationBarScreenButton extends Voicing( Node ) {

// Hook up the input listener
const pressListener = this.buttonModel.createPressListener( {
tandem: options.tandem.createTandem( 'pressListener' )
tandem: Tandem.OPT_OUT // PushButtonModel provides a firedEmitter which is sufficient
} );
this.addInputListener( pressListener );

1 comment on commit 92314e0

@zepumph
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.