Skip to content

Commit

Permalink
use findStringProperty to get a default accessibleName for AccordionB…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Nov 8, 2024
1 parent e52e7eb commit 66cf8e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/AccordionBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Shape } from '../../kite/js/imports.js';
import InstanceRegistry from '../../phet-core/js/documentation/InstanceRegistry.js';
import optionize, { combineOptions } from '../../phet-core/js/optionize.js';
import StrictOmit from '../../phet-core/js/types/StrictOmit.js';
import { assertNoAdditionalChildren, HighlightFromNode, InteractiveHighlighting, isHeightSizable, isWidthSizable, LayoutConstraint, Node, NodeOptions, PaintableOptions, ParallelDOM, Path, PathOptions, PDOMPeer, Rectangle, RectangleOptions, Sizable, Text } from '../../scenery/js/imports.js';
import { assertNoAdditionalChildren, HighlightFromNode, InteractiveHighlighting, isHeightSizable, isWidthSizable, LayoutConstraint, Node, NodeOptions, PaintableOptions, ParallelDOM, Path, PathOptions, PDOMPeer, PDOMUtils, Rectangle, RectangleOptions, Sizable, Text } from '../../scenery/js/imports.js';
import sharedSoundPlayers from '../../tambo/js/sharedSoundPlayers.js';
import TSoundPlayer from '../../tambo/js/TSoundPlayer.js';
import EventType from '../../tandem/js/EventType.js';
Expand Down Expand Up @@ -416,6 +416,11 @@ export default class AccordionBox extends Sizable( Node ) {
return options;
};

// If no accessibleName has been provided, try to find one from the titleNode
if ( !options.accessibleName && options.titleNode ) {
this.accessibleName = PDOMUtils.findStringProperty( options.titleNode );
}

this.constraint = new AccordionBoxConstraint(
this,
contentNode,
Expand Down

0 comments on commit 66cf8e5

Please sign in to comment.