Skip to content

Commit

Permalink
pass augmented options to super mixin, phetsims/scenery#1340 phetsims…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 4, 2022
1 parent 193df01 commit 3c700f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions js/accessibility/AccessibleNumberSpinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ const AccessibleNumberSpinner = <SuperType extends Constructor>( Type: SuperType
ariaOrientation: Orientation.VERTICAL // by default, number spinners should be oriented vertically
}, providedOptions );

args[ optionsArgPosition ] = options;

super( ...args );

const thisNode = this as unknown as Node;
Expand Down
12 changes: 7 additions & 5 deletions js/accessibility/AccessibleSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ const AccessibleSlider = <SuperType extends Constructor>( Type: SuperType, optio
drag: _.noop // called once per drag event, before other modifications to the valueProperty
}, providedOptions );

super( ...args );

// members of the Node API that are used by this trait
assertHasProperties( this, [ 'addInputListener', 'removeInputListener' ] );

// AccessibleSlider uses 'drag' terminology rather than 'change' for consistency with Slider
assert && assert( options.startChange === undefined, 'AccessibleSlider sets startChange through options.startDrag' );
options.startChange = options.startDrag;
Expand All @@ -71,6 +66,13 @@ const AccessibleSlider = <SuperType extends Constructor>( Type: SuperType, optio
assert && assert( options.onChange === undefined, 'AccessibleSlider sets onChange through options.drag' );
options.onChange = options.drag;

args[ optionsArgPosition ] = options;

super( ...args );

// members of the Node API that are used by this trait
assertHasProperties( this, [ 'addInputListener', 'removeInputListener' ] );

// handle all accessible event input
const accessibleInputListener = this.getAccessibleValueHandlerInputListener();
( this as unknown as Node ).addInputListener( accessibleInputListener );
Expand Down

1 comment on commit 3c700f6

@zepumph
Copy link
Member Author

@zepumph zepumph commented on 3c700f6 Feb 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.