Skip to content

Commit

Permalink
Improve strategy for avoiding instrumentation for ButtonNode, see #405
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 14, 2018
1 parent 44e6838 commit 0104b1a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions js/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@ define( require => {
}
} );

let tandem = options.tandem; // don't pass tandem to the ButtonNode
delete options.tandem;

// @private button, will be set to correct value when property observer is registered
// TODO: buttonNode should not get passed all the comboBox options. This seems like a codesmell, see https://github.com/phetsims/sun/issues/314
this.buttonNode = new ButtonNode( new ComboBoxItemNode( items[ 0 ], itemWidth, itemHeight, options.itemXMargin ), options );
Expand All @@ -280,8 +277,6 @@ define( require => {
thisElementName: AccessiblePeer.PRIMARY_SIBLING
} );

options.tandem = tandem; // restore the tandem after passing other options to the ButtonNode

// button interactivity
this.buttonNode.cursor = 'pointer';
this.buttonNode.addInputListener( {
Expand Down Expand Up @@ -529,6 +524,9 @@ define( require => {

}, options );

// The ButtonNode is not instrumented
delete options.tandem;

super();

this.labelContent = options.a11yButtonLabel;
Expand Down

0 comments on commit 0104b1a

Please sign in to comment.