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

Button, text input and other interactive form elements should be covered in list of interactive elements in touch handling code (in touchHandling.js) #178

Closed
sumahadevan opened this issue Dec 10, 2019 · 2 comments

Comments

@sumahadevan
Copy link

The following Javascript issue can be seen and checked in the touch handling Javascript code:

https://github.com/readium/r2-navigator-kotlin/blob/develop/r2-navigator/src/main/assets/scripts/touchHandling.js

Only hyperlinks ('a') are handled in the function handleTouchStart(), while other elements (including buttons and input fields) are not handled. Other interactive Javascript elements need to be handled here in the same manner as has recently been done in the iOS version (readium/swift-toolkit#143).

This was resolved for iOS by introducing a simple utility function isInteractiveElement() in the corresponding touch handling Javascript file there:

https://github.com/readium/r2-navigator-swift/blob/develop/r2-navigator-swift/EPUB/Resources/Scripts/gestures.js

This Javascript issue was originally logged in the repository r2-testapp-kotlin, but in the refactoring the relevant file touchHandling.js has moved to the r2-navigator-kotlin repository. When initially logging the issue, I also verified (working with earlier build V2.0.0 beta 6) that simply copying over the same function isInteractiveElement() and invoking it at the beginning of handleTouchStart fully resolves the issue of all these interactive Javascript elements not working. Link to the originally logged issue:

#248

The issue can be tested for buttons and input fields with the following ePub3 - I had to rename the .epub as a .zip to upload it (you may unpack it or rename it as .epub and then look at the code of individual XHTML pages, which is just basic Javascript).

button-click-epub3.zip

@aferditamuriqi
Copy link
Member

duplicate #248

@sumahadevan
Copy link
Author

@aferditamuriqi you are correct that this is a duplicate, the only reason I logged it again is that the relevant Javascript file touchHandling.js has now moved to the navigator. It is up to you which one of these two issues you would like to keep open, as in both of them I have indicated the same fix in touchHandling.js, based on the corresponding Javascript fix made in the iOS version (and having this fix working on Android also would be a great help in working with my interactive ePUB3s on Android as well).

@mickael-menu mickael-menu transferred this issue from readium/r2-navigator-kotlin Jul 29, 2022
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

2 participants