phetsims / molecules-and-light

"Molecules and Light" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 5 forks source link

LoL Ctrl+0 to remove zoom doesn't seem to work #358

Closed KatieWoe closed 4 years ago

KatieWoe commented 4 years ago

For https://github.com/phetsims/QA/issues/513. Win 10 Chrome in Legends of Learning harness. When testing the LoL harness, I noticed that I was able to zoom in and out as expected using Ctrl+scroll, Ctrl++, and Ctrl+-, but that Ctrl+0 did not seem to do anything.

jessegreenberg commented 4 years ago

Interesting, thanks. So what I am seeing is that it depends on where focus is within the simulation. If focus is on a the photon emitter radio buttons or the molecule selection radio buttons keyboard zoom control (+, -, 0) does not work at all. However, if you are on any other button, all zoom controls (+, -, 0) work OK.

KatieWoe commented 4 years ago

Update: this seems to be an issue for iframes actually, where, in addition to Ctrl+0 not working, Ctrl++ and Ctrl+- seem to control the page, not the sim.

jessegreenberg commented 4 years ago

Actually, I just confirmed https://github.com/phetsims/molecules-and-light/issues/358#issuecomment-656851007 outside of the iframe as wel, it is not possible to zoom in with keyboard if focus is on those radio button groups.

KatieWoe commented 4 years ago

Recording: https://drive.google.com/file/d/1Ka8QFEKoEszbuZnxAaUtl7KzXtOOw91z/view?usp=sharing

jessegreenberg commented 4 years ago

Thanks @KatieWoe - I don't have access to that file, could you please share?

jessegreenberg commented 4 years ago

I think there are two issues being discussed here.

this seems to be an issue for iframes actually, where, in addition to Ctrl+0 not working, Ctrl++ and Ctrl+- seem to control the page, not the sim.

This is true, and actually expected - sorry I didn't mention this. If using keyboard commands, the browser assumes that you are sending commands to the parent web page, and so zoom commands will not go to the iframe, but will go to the parent. This is partly for security, an iframe should generally not intercept input from the parent frame. Zooming with keyboard should work in an iframe if focus is within the simulation however.

The other issue is that RadioButtonGroup is blocking zoom because of the change in https://github.com/phetsims/scenery/issues/1056, which is not related to iframes.

jessegreenberg commented 4 years ago

https://github.com/phetsims/scenery/issues/1056 will likely involve substantial changes that should not be pulled into the release branch. I think I am going to try a specific commit that will fix the issue for MAL without introducing lots of changes that would de-stabilize the release..

jessegreenberg commented 4 years ago

This has been fixed for the release branch.

jessegreenberg commented 4 years ago

To clarify, what I expect to work now in the release branch is that zoom commands from a keyboard should control zoom level when focus is on a radio button group. But I do not expect zoom commands with a keyboard to work in the LoL harness unless keyboard focus is within the simulation.

KatieWoe commented 4 years ago

Looks fixed in https://github.com/phetsims/QA/issues/520 on ChromeOS. Closing