phetsims / resistance-in-a-wire

"Resistance in a Wire" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/resistance-in-a-wire
GNU General Public License v3.0
1 stars 4 forks source link

JAWS changes the slider value when focus leaves the slider #167

Closed jessegreenberg closed 6 years ago

jessegreenberg commented 6 years ago

When focus leaves a slider, JAWS changes its value. Steps to reproduce:

The slider will increment to 9.00 cm^2

jessegreenberg commented 6 years ago

This is not an issue in 1.5.0-rc.7

jessegreenberg commented 6 years ago

This happens in Firefox but not Chrome.

jessegreenberg commented 6 years ago

This happens in FF without JAWS too.

jessegreenberg commented 6 years ago

Sliders get the change event in FF on blur. I want to know more about when the change event is generally supposed to be triggered.

jessegreenberg commented 6 years ago

Aha, this looks like the critical piece of information:

Works with the min and max attributes to limit the increments at which a numeric or date-time value can be set. It can be the string any or a positive floating point number. If this attribute is not set to any, the control accepts only values at multiples of the step value greater than the minimum.

EDIT: from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step

jessegreenberg commented 6 years ago

This has been fixed with the above commit, step has been set to "any", and we only handle change if the element has focus, we don't update if the browser is trying to "commit" a value that is divisible by the step size on the blur event.