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
  • Loading branch information
zepumph committed Jan 10, 2025
1 parent a323c34 commit b3d353c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/listeners/PressListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,10 @@ export default class PressListener extends EnabledComponent implements TInputLis
phetioEnabledPropertyInstrumented: false,

// phet-io (EnabledComponent)
// For PhET-iO instrumentation. If only using the PressListener for hover behavior, there is no need to
// instrument because events are only added to the data stream for press/release and not for hover events. Please pass
// Tandem.OPT_OUT as the tandem option to not instrument an instance.
// For PhET-iO instrumentation. Please note, many occurrences opt out of this instrumentation. The PhET-iO design
// requires that there is some way to know when user input triggered a change (instead of only having a model
// Property instrumented). It is only required though if there isn't a better way to instrument the view. For
// example, many push buttons have a "firedEmitter" that is more descriptive, so they opt out of this. See https://github.com/phetsims/scenery/issues/1680
tandem: Tandem.REQUIRED,

phetioReadOnly: true,
Expand Down

1 comment on commit b3d353c

@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.