phetsims / sun

User-interface components for PhET simulations, built on top of Scenery.
MIT License
4 stars 12 forks source link

AccessibleValueHandler gives a11yCreateContextResponseAlert incorrect values #729

Closed jessegreenberg closed 2 years ago

jessegreenberg commented 2 years ago

Specifically, the this.oldValue is passed to a11yCreateContextResponseAlert but it is already updated by the time the function is called. I looked into waiting to update the value but I couldn't get there. In particular, the oldValue is set every time the value Property changes. But alertContextResponse is only called once when the drag ends.

I am going to add a new field for the value on interaction start and pass that as the old value to a11yCreateContextResponseAlert.

jessegreenberg commented 2 years ago

No sim is using the args of a11yCreateContextResponseAlert which is why it hasn't been an issue.

jessegreenberg commented 2 years ago

Done in the above commit, it is working well for my needs in greenhouse-effect.