From 3086e97a6254ed5907ec2bb35653d963e00395bb Mon Sep 17 00:00:00 2001 From: Jesse Date: Tue, 11 Sep 2018 13:43:38 -0400 Subject: [PATCH] don't use 'any' attribute for step, it doesn't work with a11y gesture input, see #397 --- js/accessibility/AccessibleSlider.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/accessibility/AccessibleSlider.js b/js/accessibility/AccessibleSlider.js index ab9f1341..5ec026f1 100644 --- a/js/accessibility/AccessibleSlider.js +++ b/js/accessibility/AccessibleSlider.js @@ -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 );