Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari plays error sound when keys are pressed in full screen mode #1031

Closed
jessegreenberg opened this issue Jan 15, 2020 · 2 comments
Closed
Assignees

Comments

@jessegreenberg
Copy link
Contributor

This first came up in phetsims/friction#167 and has come up again in phetsims/molarity#210 so we should see if we can find a general solution.

When in full screen mode, Safari will play a "bonk" sound if any key is pressed other than "tab" and "enter"/"spacebar" on buttons.

The "bonk" stops playing if we add event.preventDefault() in the event listeners. It seems like we could either find some HTML attribute to add that stops this from happening (no idea if there is one) or hopefully move preventDefault() to a smart place that handles this generally.

@jessegreenberg
Copy link
Contributor Author

I discussed with @zepumph - we talked about having a place somewhere (like in A11yPointer) to call event.preventDefault when in full screen mode to generally prevent the "bonk" error sound. But this feels really risky. We need to avoid preventing default on tab, space, enter, escape keys at the very least. And there are probably many others too where we do NOT want to preventDefault.

I am going to look for attributes that might suppress this but if I cannot find any we will continue to use preventDefault in each case.

@jessegreenberg
Copy link
Contributor Author

I did some searching (particularly here https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API) but didn't see any attributes to add to prevent this error sound. We will continue on a case by case basis. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant