diff --git a/js/ComboBox.js b/js/ComboBox.js index 610a2beb..c17f2730 100644 --- a/js/ComboBox.js +++ b/js/ComboBox.js @@ -21,6 +21,7 @@ define( require => { 'use strict'; // modules + const AccessiblePeer = require( 'SCENERY/accessibility/AccessiblePeer' ); const BooleanProperty = require( 'AXON/BooleanProperty' ); const ComboBoxButton = require( 'SUN/ComboBoxButton' ); const ComboBoxIO = require( 'SUN/ComboBoxIO' ); @@ -137,7 +138,15 @@ define( require => { fill: options.listFill, stroke: options.listStroke, lineWidth: options.listLineWidth, - visible: false + visible: false, + + // a11y + // the list box is aria-labelledby its own label sibling + ariaLabelledbyAssociations: [ { + otherNode: this.button, + otherElementName: AccessiblePeer.LABEL_SIBLING, + thisElementName: AccessiblePeer.PRIMARY_SIBLING + } ] } ); listParent.addChild( this.listBox ); this.listParent = listParent; // @private diff --git a/js/ComboBoxListBox.js b/js/ComboBoxListBox.js index 43eb3fbb..8f0a1f9f 100644 --- a/js/ComboBoxListBox.js +++ b/js/ComboBoxListBox.js @@ -9,7 +9,6 @@ define( require => { 'use strict'; // modules - const AccessiblePeer = require( 'SCENERY/accessibility/AccessiblePeer' ); const ComboBoxListItemNode = require( 'SUN/ComboBoxListItemNode' ); const Emitter = require( 'AXON/Emitter' ); const EmitterIO = require( 'AXON/EmitterIO' ); @@ -147,13 +146,6 @@ define( require => { super( content, options ); - // a11y - the list box is aria-labelledby its own label sibling - this.addAriaLabelledbyAssociation( { - otherNode: button, - otherElementName: AccessiblePeer.LABEL_SIBLING, - thisElementName: AccessiblePeer.PRIMARY_SIBLING - } ); - // @public {ComboBoxListItemNode|null} the ComboBoxListItemNode that has focus this.focusedItemNode = null;