Skip to content

Commit

Permalink
add aria-labelledby association and added default label tag name, see #…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed May 17, 2018
1 parent f404165 commit d0005ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/buttons/RadioButtonGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ define( function( require ) {
'use strict';

// modules
var AccessiblePeer = require( 'SCENERY/accessibility/AccessiblePeer' );
var Color = require( 'SCENERY/util/Color' );
var ColorConstants = require( 'SUN/ColorConstants' );
var FocusHighlightPath = require( 'SCENERY/accessibility/FocusHighlightPath' );
Expand Down Expand Up @@ -53,6 +54,7 @@ define( function( require ) {

// a11y
tagName: 'ul',
labelTagName: 'h3',
groupFocusHighlight: true
}, options );

Expand Down Expand Up @@ -287,6 +289,12 @@ define( function( require ) {
LayoutBox.call( this, options );
var self = this;

// a11y - this node's primary sibling is aria-labelledby its own label so the label content is read whenever
// a member of the group receives focus
// TODO: This will need to be updated with changes from https://github.com/phetsims/scenery/issues/701
this.setAriaLabelledByNode( this );
this.ariaLabelContent = AccessiblePeer.LABEL_SIBLING;

// When the entire RadioButtonGroup gets disabled, gray them out and make them unpickable (and vice versa)
var enabledListener = function( isEnabled ) {
self.pickable = isEnabled;
Expand Down

0 comments on commit d0005ca

Please sign in to comment.