I've been puzzled as to why this behaviour happens on safari. I'm trying to get selection when i type some text and for that i use the window.getSelection() and it works perfectly fine on Firefox, Chrome, Opera and so on giving me something like:
Selection {}
anchorNode: text
anchorOffset: 14
baseNode: text
baseOffset: 14
extentNode: text
extentOffset: 14
focusNode: text
focusOffset: 14
isCollapsed: true
rangeCount: 1
type: "Caret"
__proto__: Selection
However on safari9 when i do the exact same thing, the result will be this:
Selection
anchorNode: null
anchorOffset: 0
baseNode: null
baseOffset: 0
extentNode: null
extentOffset: 0
focusNode: null
focusOffset: 0
isCollapsed: true
rangeCount: 0
type: "None"
__proto__: SelectionPrototype
I am wondering if this is something i'm doing wrong? If it's indeed a bug or it's not working is there a possible workaround? Or another method to obtain the same information that will work on most browsers?