Skip to content

Commit

Permalink
remove custom a11y listener now that ButtonListener is instrumented, …
Browse files Browse the repository at this point in the history
…see #487
  • Loading branch information
jessegreenberg committed Apr 1, 2019
1 parent 89ac5f0 commit a16508f
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions js/Checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,16 @@ define( function( require ) {
content.pickable = false; // since there's a pickable rectangle on top of content

// interactivity
var fire = function() {
if ( self.enabledProperty.value ) {
var newValue = !property.value;
toggledEmitter.emit( newValue );
}
};

var checkboxButtonListener = new ButtonListener( {
fire: fire
fire: function() {
if ( self.enabledProperty.value ) {
var newValue = !property.value;
toggledEmitter.emit( newValue );
}
}
} );
this.addInputListener( checkboxButtonListener );

// a11y - fire the listener when checkbox is clicked with keyboard or assistive technology
var changeListener = {
change: fire
};
this.addInputListener( changeListener );

// sync with property
var checkboxCheckedListener = function( checked ) {
self.checkedNode.visible = checked;
Expand Down

0 comments on commit a16508f

Please sign in to comment.