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

Xhtml file does not support zoom #363

Closed
KatieWoe opened this issue Jul 13, 2020 · 10 comments
Closed

Xhtml file does not support zoom #363

KatieWoe opened this issue Jul 13, 2020 · 10 comments
Labels

Comments

@KatieWoe
Copy link
Contributor

Test device
Dirac
Operating System
MacOS 10.12.6
Browser
Safari 12.1.2
Problem description
For phetsims/qa#513
Zooming doesn't seem to work on the xhtml file in safari. Tried using the command++/-. The sim would twitch, but not zoom in at all.

@KatieWoe
Copy link
Contributor Author

KatieWoe commented Jul 13, 2020

Seems to happen on Chrome and Windows as well.

@KatieWoe KatieWoe changed the title Mac Safari xhtml file does not support zoom Xhtml file does not support zoom Jul 13, 2020
@jessegreenberg
Copy link
Contributor

Interesting, thanks. Zoom works correctly when using mouse/wheel. And command + +/- works if focus is within the simulation. But if there is no focus then it doesn't work.

@jessegreenberg
Copy link
Contributor

jessegreenberg commented Jul 13, 2020

In HTML, this fires: document.body.addEventListener( 'keydown', () => console.log( 'heyo!' ) ). But in XHTML I never see the output. So adding listeners to the body is problematic in XHTML?

In the XHTML document.activeElement is the document.body still.

@jessegreenberg
Copy link
Contributor

Changing KeyStateTracker to attach listeners to window instead of body seems to fix things and still work in the HTML, but I don't understand why it isn't working in the HTML in the first place. I might end up doing this, but want to think about it a little more.

@jessegreenberg
Copy link
Contributor

It looks like listeners attached to the document are also correctly called in XHTML. Not a huge difference but it is closer to body in the hierarchy, so I am going to attach to document.

@jessegreenberg
Copy link
Contributor

@KatieWoe can you please confirm this is fixed in https://phet-dev.colorado.edu/html/molecules-and-light/1.6.0-dev.1/phet/xhtml/molecules-and-light_all.xhtml? If so I will merge change with release branch.

@KatieWoe
Copy link
Contributor Author

Looks good on Win 10 Chrome and Mac 10.15 Safari

@KatieWoe KatieWoe assigned jessegreenberg and unassigned KatieWoe Jul 14, 2020
@jessegreenberg
Copy link
Contributor

Great, thanks @KatieWoe

@jessegreenberg
Copy link
Contributor

cherry-pick complete, dependencies updated in e39683f

@KatieWoe
Copy link
Contributor Author

This is working in phetsims/qa#520 on ChromeOS. Closing

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

No branches or pull requests

2 participants