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

Delegate click/tab even prevention to app #20

Open
chocolatkey opened this issue Nov 1, 2022 · 1 comment
Open

Delegate click/tab even prevention to app #20

chocolatkey opened this issue Nov 1, 2022 · 1 comment

Comments

@chocolatkey
Copy link
Member

Are you able to get a bool result from the tap/click events? Then you can delegate this choice to the app.

See https://github.com/readium/kotlin-toolkit/blob/e5231436cac3a802fb5e406eda63bce4f1a5549d/readium/navigator/src/main/assets/_scripts/src/gestures.js#L33-L40

Originally posted by @mickael-menu in #12 (comment)

@chocolatkey
Copy link
Member Author

That can't be done unfortunately because you can't make the browser wait for completion of an async function before calling preventDefault(). Since the injectables communicate with an async message to send the event, and then another back that would contain the bool you speak of, the event will have already happened and will no longer be preventable. I'm still thinking of a solution, suggestions welcome.

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