naoak / WebViewMarker

Support library for text selection on Android WebView. (forked from BTAndroidWebViewSelection)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rangy deserialize doesn't works as expected!

Neernay opened this issue · comments

hi..
i am trying to deserialize the selection after restoring the selection from DB which was saved while selecting the text.
But the Rangy deserialize is not working as it has to.
The serializeSelection returns something like this
' 2/5/3/5/1/2:0,13/5/3/5/1/2:24'
but when the same serialized selection is deserialized it throws the following error Error in Rangy Serializer module: deserializePosition failed: node <DIV>[7] has no child with index 13, 0

Any idea about it?

I've never tried Rangy serialization. Can I have sample?
Or have you already resolved this issue?

Were you able to solve this issue. We are also seeing the same error.

Similar problem here - no matter what i try i cannot manage to make serialization work. However strangely serializing highlights works beautifully but doesn't give me a handle to navigate back to the highlighted selection.

you are probably highlighting the text before deserializing. highlighting changes the DOM. that was my problem anyway.