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

fix oxView focus stealing #979

Open
dave-doty opened this issue Sep 5, 2024 · 1 comment
Open

fix oxView focus stealing #979

dave-doty opened this issue Sep 5, 2024 · 1 comment
Labels
invalid This doesn't seem right

Comments

@dave-doty
Copy link
Member

If you click in the oxView window, that iframe takes the focus, and scadnano keyboard shortcuts no longer work even though we are listening on document.body, but perhaps iframes are considered not part of the body since they host a whole other webpage.

Perhaps this is necessary, but the crazy thing is that if you click in the scadnano main view, even selecting strands and editing, it does not return the focus to scadnano, so pressing, e..g, delete, will delete the selected base in oxView rather than the selected strand in scadnano.

Focus can be restored by clicking on the menu or separators or other non-SVG.

However, ideally:

  1. clicking anywhere outside of the iframe should restore the focus to main view.
  2. Even more ideally, we redirect keyboard events from the iframe to scadnano so that keyboard shortcuts are always interpreted by scadnano. Perhaps we want to relax this or make it optional if we manage to get more editing capabilities in the oxView window, but for now since it is read-only from the perspective of scadnano (no changes are propagated back to scadnano), it makes sense for keyboard shortcuts always to be interpreted by scadnano rather than oxView.
@dave-doty dave-doty added the invalid This doesn't seem right label Sep 5, 2024
@dave-doty
Copy link
Member Author

Looks like the only way around this (since we are hosting from different sites) is to send a POST message from oxView to scadnano telling it about the key events: https://stackoverflow.com/questions/9393532/cross-domain-iframe-issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant