rangy icon indicating copy to clipboard operation
rangy copied to clipboard

Unable to serialize browser's native Selection

Open saraht129 opened this issue 8 years ago • 2 comments

Hi there, thanks for this great library.

I am trying to deserialize the Selection object so I can restore it later, but it seems that the rangy.serializeSelection(sel, checksum, root) method is not working with the native browser's Selection as the parameter.

Below is a snippet of my code:

var selection = window.getSelection();
var serializedSel = rangy.serializeSelection(selection, false, document.getElementById("content"));

And the error I'm getting is: Error in Rangy WrappedSelection module: getNativeSelection(): Parameter must be a Window object or DOM node

Am I missing something here? Thanks a lot.

saraht129 avatar Mar 29 '16 10:03 saraht129

Having the same issue here.

RichoHan avatar May 05 '16 18:05 RichoHan

Any updates on this issue? I'm experiencing the same.

amiraeitan avatar Nov 12 '16 17:11 amiraeitan