You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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:
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:
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).
@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).
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
The text was updated successfully, but these errors were encountered: