phetsims / molarity

"Molarity" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/molarity
GNU General Public License v3.0
2 stars 6 forks source link

Using arrow keys in solute menu in safari full screen makes "donk" sound #210

Closed KatieWoe closed 4 years ago

KatieWoe commented 4 years ago

Device: Dirac OS: 10.11 Browser: Safari Problem Description: For https://github.com/phetsims/QA/issues/464 When you are using keyboard nav in safari full screen, moving between solutes will give the mac sound for "you can't do that" a sort of donk sound. This occurs even when the sim is muted.

Visuals: https://drive.google.com/file/d/14tI1k6jgZmbL3CZN6MlSDHqptBPdtGGd/view?usp=sharing

zepumph commented 4 years ago

@jessegreenberg I unfortunately don't have a mac I can work this one out on. Do you mind taking a look, or perhaps we can pair on it tomorrow during dev meeting?

jessegreenberg commented 4 years ago

I feel as if we have encountered this before, I will search through some older issues.

jessegreenberg commented 4 years ago

Found what I think I was thinking of: https://github.com/phetsims/friction/issues/167

In this issue it is from the WASD keys. We resolved it by adding preventDefault to the keyboard event listeners.

jessegreenberg commented 4 years ago

And to clarify, the "bonk" happens when any key is pressed anywhere in the sim, not just arrow keys. I think we need a general solution to this so that we don't need to add preventDefault in these cases.

I also found this thread about it, but just for video: https://discussions.apple.com/thread/250846147, no mention of a fix.

jessegreenberg commented 4 years ago

Fixed in the above commit.

zepumph commented 4 years ago

This looks great, but the issue linked in the commit is incorrect, as 210 is in molarity.

jessegreenberg commented 4 years ago

Thanks for reviewing! I too often make that mistake, but this time I think the reference for https://github.com/phetsims/sun/commit/55602a26180bf805e3ff4b1235582df91ae3e8c3 is correct as this is phetsims/molarity#210

KatieWoe commented 4 years ago

The arrow keys have stopped this behavior, but I noticed that also happens when you select one solute options, either with space or enter, and this does still occur. Much easier to notice if you have the sim muted at the time, as normal sounds can mask it otherwise.

jessegreenberg commented 4 years ago

So the workaround that we have for the arrow keys does not work for spacebar and enter. event.preventDefault() does not stop the "bonk" from playing in full screen mode.

I did some searching and did not find any solutions. But I did find lots of reports from users that this is happening on other sites too like youtube, see https://discussions.apple.com/thread/250846147.

It seems like there is nothing we can do about this.

Adding to the a11y bug tracker and pinging @KatieWoe so that she is aware.