Skip to content

Commit

Permalink
move roundToStepSize to options, see phetsims/coulombs-law#72
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Oct 23, 2018
1 parent acfb7a5 commit 6ab271b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions js/FaucetNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ define( function( require ) {

tandem: Tandem.required,
phetioType: FaucetNodeIO,
phetioEventType: 'user'
phetioEventType: 'user',

// a11y - when using keyboard, flowRateProperty will round to nearest keyboardStep of AccessibleSlider
roundToStepSize: true
}, options );

assert && assert( ( 1000 * options.tapToDispenseAmount / options.tapToDispenseInterval ) <= maxFlowRate );
Expand Down Expand Up @@ -279,7 +282,6 @@ define( function( require ) {
self.mutate( options );

// mix accessible slider functionality into this node
options.roundToStepSize = true;
this.initializeAccessibleSlider(
flowRateProperty,
new Property( new Range( 0, maxFlowRate ) ),
Expand Down
4 changes: 2 additions & 2 deletions js/NumberControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ define( function( require ) {
phetioType: NumberControlIO,

// a11y
groupFocusHighlight: true
groupFocusHighlight: true,
roundToStepSize: true
}, options );


Expand Down Expand Up @@ -215,7 +216,6 @@ define( function( require ) {
// where it makes no sense to call them startDrag and endDrag.
startDrag: options.sliderStartCallback || options.startCallback,
endDrag: options.sliderEndCallback || options.endCallback,
roundToStepSize: true,
tandem: options.tandem.createTandem( 'slider' )
} );

Expand Down
6 changes: 4 additions & 2 deletions js/SpectrumSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ define( function( require ) {
cursorStroke: 'black',

// phet-io
tandem: Tandem.required
tandem: Tandem.required,

// a11y - should valueProperty round to the nearest interval of AccessibleSlider stepSize when using keyboard?
roundToStepSize: true

}, options );

Expand Down Expand Up @@ -312,7 +315,6 @@ define( function( require ) {
};

// mix accessible slider functionality into HSlider
options.roundToStepSize = true;
var rangeProperty = new Property( new Range( options.minValue, options.maxValue ) );
this.initializeAccessibleSlider( valueProperty, rangeProperty, new BooleanProperty( true ), options );
}
Expand Down

0 comments on commit 6ab271b

Please sign in to comment.