I have an application that displays text, and when the text is clicked, determines the word clicked and fires an event containing that information. The word detection is performed via JavaScript Selection - Range objects. This works perfectly in all desktop browsers, as well as the Nexus 7 and iPad. On the MS Surface however, the range returned is invalid. Where the other browsers can return a valid node for the range endpoint(s), on the surface there is only an blank space, and an offset of 0 - both of which are inaccurate.
The tools I am using:
- GWT
- Rangy (JS Selection/Range library)
- GWT-Selection with the same results.
Again, in other browsers / devices, rangy.getSelection().getRangeAt(0).inspect() returns node information and valid offsets, but on the Surface, I get nothing, just an empty inspect, similar to:
"[WrappedRange(" ":0, "":0)]"
(message not verbatim, copy pasting from the Surface being a pain)
Any ideas as to what may be going on / how I can fix it?