Skip to content

Commit

Permalink
Search for a default accessibleName in AquaRadioButton, see #911 and p…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Nov 8, 2024
1 parent 66cf8e5 commit 1508a67
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/AquaRadioButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import TProperty from '../../axon/js/TProperty.js';
import InstanceRegistry from '../../phet-core/js/documentation/InstanceRegistry.js';
import optionize from '../../phet-core/js/optionize.js';
import StrictOmit from '../../phet-core/js/types/StrictOmit.js';
import { assertNoAdditionalChildren, Circle, FireListener, isWidthSizable, LayoutConstraint, Node, NodeOptions, Rectangle, SceneryConstants, TPaint, TrimParallelDOMOptions, Voicing, VoicingOptions, WidthSizable } from '../../scenery/js/imports.js';
import { assertNoAdditionalChildren, Circle, FireListener, isWidthSizable, LayoutConstraint, Node, NodeOptions, PDOMUtils, Rectangle, SceneryConstants, TPaint, TrimParallelDOMOptions, Voicing, VoicingOptions, WidthSizable } from '../../scenery/js/imports.js';
import multiSelectionSoundPlayerFactory from '../../tambo/js/multiSelectionSoundPlayerFactory.js';
import TSoundPlayer from '../../tambo/js/TSoundPlayer.js';
import Tandem from '../../tandem/js/Tandem.js';
Expand Down Expand Up @@ -215,6 +215,11 @@ export default class AquaRadioButton<T> extends WidthSizable( Voicing( Node ) )
};
property.link( pdomCheckedListener );

// pdom - If an accessibleName was not provided, search for one in the labelNode
if ( !options.accessibleName ) {
options.accessibleName = PDOMUtils.findStringProperty( labelNode );
}

// pdom - every button in a group of radio buttons should have the same name, see options for more info
if ( options.a11yNameAttribute !== null ) {
this.setPDOMAttribute( 'name', options.a11yNameAttribute );
Expand Down

0 comments on commit 1508a67

Please sign in to comment.