phetsims / mean-share-and-balance

"Mean: Share and Balance" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 1 forks source link

Impossible to balance beam with keyboard input #195

Closed marlitas closed 3 months ago

marlitas commented 3 months ago

In certain scenarios it is impossible to balance the beam if the mean value has a decimal. I console logged what the slider was setting the NumberProperty to and I noticed that it looks like it might be some kind of rounding error:

image

I'm not sure if this is a bug in AccessibleValueHandler or if this is something I should fix via brute force in the model... The latter feels icky...

I tried the following, but documentation indicates they will specifically not work with the shiftKeyboardStep, which is where we hit the problem.

marlitas commented 3 months ago

This was fixed above by using @jessegreenberg's suggestion of a11yMapValue. I also made sure to tie that change to https://github.com/phetsims/sun/issues/837 so that it can be updated in the future if the API changes. Closing!