phetsims / inverse-square-law-common

GNU General Public License v3.0
1 stars 2 forks source link

positionDescriber.lastMoveCloser relies on focus events #68

Closed zepumph closed 5 years ago

zepumph commented 5 years ago

Promoting TODO from https://github.com/phetsims/inverse-square-law-common/issues/67,

It is a shame that this runs on focus. I'm actually not positive that this works correctly on mobile as is. We should sort this out before publication.

@jessegreenberg perhaps you have some ideas. Basically we set lastMoveCloser to null when focusing on a position slider, in effect "resetting the interaction." Can you think of an alternative way to accomplish this? I have come up with only one, bad idea. We could reset it on other, independent model property changes, like when the valueProperty changes. This doesn't guarantee anything though.

Marking pretty high because I think this blocks GFLB publication.

jessegreenberg commented 5 years ago

It is a bummer that this is no longer simple to do. I can't think of any good way to do this. The change event is fired when the value was "committed" rather than every time it changed (https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event), so I wondered about changing focus to change for these listeners. But change is still fired every value change with sliders and not on 'moving to the next thing'.

jessegreenberg commented 5 years ago

What you recommend seems like a good way to do this, though I agree it does add complexity and won't be a perfect alternative.

A large part of me wonders if it is acceptable to ignore this on mobile and just make sure the sim runs gracefully in these cases. Mobile web accessibility currently does not support this kind of interaction and IMO it is because of things that are missing in the web specifications. I think it would be good to discuss this with the larger group.

zepumph commented 5 years ago

Let's talk about this tomorrow! And maybe also perhaps with @emily-phet.

zepumph commented 5 years ago

@jessegreenberg and I discussed this today. Here is the actual feature that we find doesn't work on mobile:

If instead the second action was to move farther, then you would hear "farther away" because that is still different from the previous value.

We decided that this is not enough of a bug to spend any energy into.

In general we marked a discussion topic with @emily-phet next week about how we don't really have any way to keep track of "discrete" or separate interactions.

I'm going to close this for now, and we can open a new issue for the general case if needed.