Skip to content

Commit

Permalink
add aria-roledescription to the screen buttons, #355
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 21, 2017
1 parent 1d06149 commit 6bdd768
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/HomeScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ define( function( require ) {

// a11y-strings
var simScreensString = 'Sim Screens';
var simScreenString = 'Sim Screen';
var homeScreenDescriptionPatternString = 'Come explore with {{name}}. It has {{screens}} screens.';

// constants
Expand Down Expand Up @@ -105,6 +106,7 @@ define( function( require ) {
parentContainerTagName: 'li'
};


var isLarge = true;
var largeScreenButton = new ScreenButton(
isLarge,
Expand Down Expand Up @@ -150,6 +152,9 @@ define( function( require ) {
largeScreenButton.addAccessibleInputListener( { click: toggleListener } );
// largeScreenButton.mouseArea = largeScreenButton.touchArea = Shape.bounds( largeScreenButton.bounds ); // cover the gap in the vbox

// a11y - add the right aria attributes to the buttons
smallScreenButton.setAccessibleAttribute( 'aria-roledescription', simScreenString );
largeScreenButton.setAccessibleAttribute( 'aria-roledescription', simScreenString );

return { screen: screen, small: smallScreenButton, large: largeScreenButton, index: index };
} );
Expand Down

0 comments on commit 6bdd768

Please sign in to comment.