Skip to content

Commit

Permalink
Implement accessibleName and helpText in ABSwitch, see phetsims/scene…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Oct 28, 2024
1 parent 79552ba commit 1ca9716
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/ABSwitch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Property from '../../axon/js/Property.js';
import TEmitter from '../../axon/js/TEmitter.js';
import InstanceRegistry from '../../phet-core/js/documentation/InstanceRegistry.js';
import optionize, { combineOptions } from '../../phet-core/js/optionize.js';
import { AlignBox, AlignGroup, HBox, HBoxOptions, Node, PressListener, SceneryConstants } from '../../scenery/js/imports.js';
import { AlignBox, AlignGroup, HBox, HBoxOptions, Node, ParallelDOM, PressListener, SceneryConstants } from '../../scenery/js/imports.js';
import Tandem from '../../tandem/js/Tandem.js';
import sun from './sun.js';
import ToggleSwitch, { ToggleSwitchOptions } from './ToggleSwitch.js';
Expand Down Expand Up @@ -118,6 +118,10 @@ export default class ABSwitch<T> extends HBox {

super( options );

// pdom - Setting accessibleName and helpText on ABSwitch forwards the values to the actual ToggleSwitch.
ParallelDOM.forwardAccessibleName( this, toggleSwitch );
ParallelDOM.forwardHelpText( this, toggleSwitch );

this.property = property;
this.valueA = valueA;
this.valueB = valueB;
Expand Down

0 comments on commit 1ca9716

Please sign in to comment.