readium/r2-navigator-swift

Urgent - second page word hi-lighter is not working in landscape

singhranakumar22gmailcom opened this issue · 1 comments

Bug Report

i am using readium library for epub and i am trying with javascript to select the word by it's text-id . In landscape it's working fine for 1st page but for second page it's not working. i am using changeTextColor(fragmentId: String) function for hi-lighter , in this function fragmentId printing correctly for second page also, but text is not getting hi-lighted.

Second page word hi-lighter is not working in landscape

r2-shared-swift:
r2-streamer-swift:
r2-navigator-swift:
r2-opds-swift:
r2-lcp-swift:

macOS: 11.2
platform: x86_64
Xcode 12.4
Build version 12D4e

iOS version: 14.4
Model (e.g. iPhone 11 Pro Max): iPhone 12 Pro Max
Is it an emulator? Yes
func changeTextColor(fragmentId: String) {
          print(fragmentId)
       let scc = "document.getElementById('\(fragmentId)').style.color='#EA4343'; setTimeout(function(){ document.getElementById('\(fragmentId)').style.color = \"#000000\";}, 1500);"
       
       let script = "spread.eval('', \"\(scc.replacingOccurrences(of: "\"", with: "\\\""))\");"

        webView.evaluateJavaScript(script, completionHandler: nil)
}


As per your suggestion in the other issue i have implemented spread.eval() in spreadview.swift and it's not working for second page. readium/swift-toolkit#132

Our app is about to go live so can we have a session to resolve this issue.