Closed rahulk11 closed 4 years ago
Its working now. It was my mistake actually. I was closing the action menu on the click event which also was setting the selection to empty before it could reach the JS method execution. Now I am closing my action menu after i receive a callback from JS to my native code.
Now, another issue is there. Highlighting works properly on the first page of chapter. On other pages when i highlight an area, instead of showing the color on that page area, it shows on first page.
Found the issue. needed to set paginationInfo.pageOffset
.
Question
Hi, I included the highlights plugin into the shared-js project and rebuilt it. But, It is working in rare cases.
Upon clicking the highlight action button i am calling
ReadiumSDK.reader.plugins.highlights.addSelectionHighlight
js method but most of the time nothing happens because theSelection.getRangeAt()
returns a range with same value ofstartOffset
andendOffset
and hence therange.toString()
is empty.Is it an issue or I am doing something wrong? thanks
Steps to reproduce
ReadiumSDK.reader.plugins.highlights.addSelectionHighlight
with paramsSDKLauncher-Android
Additional information
This is the method where the selection (
range.toString() !== ''
) is empty