From b7216f8cde9b754b3483702eb2071afe5addc67f Mon Sep 17 00:00:00 2001 From: zepumph Date: Tue, 24 Oct 2017 10:39:15 -0800 Subject: [PATCH] select large button on focus, https://github.com/phetsims/joist/issues/355 --- js/HomeScreenView.js | 2 +- js/ScreenButton.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/js/HomeScreenView.js b/js/HomeScreenView.js index 4d3a892e..701183f2 100644 --- a/js/HomeScreenView.js +++ b/js/HomeScreenView.js @@ -148,7 +148,7 @@ define( function( require ) { smallScreenButton.visible && smallScreenButton.focus(); largeScreenButton.visible && largeScreenButton.focus(); }; - smallScreenButton.addAccessibleInputListener( { click: toggleListener } ); + smallScreenButton.addAccessibleInputListener( { focus: toggleListener } ); largeScreenButton.addAccessibleInputListener( { click: toggleListener } ); // largeScreenButton.mouseArea = largeScreenButton.touchArea = Shape.bounds( largeScreenButton.bounds ); // cover the gap in the vbox diff --git a/js/ScreenButton.js b/js/ScreenButton.js index 0203f397..cf2ce618 100644 --- a/js/ScreenButton.js +++ b/js/ScreenButton.js @@ -116,7 +116,8 @@ define( function( require ) { phetioEvents.end( id ); }; this.addInputListener( { down: downListener } ); - this.addAccessibleInputListener( { click: downListener } ); + this.addAccessibleInputListener( { click: function() { large && downListener(); } } ); + this.addAccessibleInputListener( { focus: function() { !large && downListener(); } } ); // Set highlight listeners to the small screen button if ( !large ) {