Skip to content

Commit

Permalink
don't use 'any' attribute for step, it doesn't work with a11y gesture…
Browse files Browse the repository at this point in the history
… input, see #397
  • Loading branch information
jessegreenberg committed Sep 11, 2018
1 parent c6983a8 commit 3086e97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/accessibility/AccessibleSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@ define( function( require ) {
// @private - entries like { {number}: {boolean} }, key is range key code, value is whether it is down
this.rangeKeysDown = {};

// value 'any' allows input to have values that are not evenly divisible by the step size, which is
// required for PhET sliders, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step
this.setAccessibleAttribute( 'step', 'any' );

// listeners, must be unlinked in dispose
var enabledRangeObserver = function( enabledRange ) {

// a11y - update enabled slider range for AT, required for screen reader events to behave correctly
self.setAccessibleAttribute( 'min', enabledRange.min );
self.setAccessibleAttribute( 'max', enabledRange.max );

// HTML requires that the value be evenly divisible by the step size to receive 'change' events, which
// is critical to work with mobile AT like VoiceOver
self.setAccessibleAttribute( 'step', ( enabledRange.max - enabledRange.min ) / 100 );
};
this._enabledRangeProperty.link( enabledRangeObserver );

Expand Down

0 comments on commit 3086e97

Please sign in to comment.