This is a bug which looks to have been introduced by [edd638f], where getRangeAt(0) was replaced with a createRange routine.
The issue is that if you select some text backwards, i.e. anchorNode is after focusNode, the range will be empty, because although Selection is "backwards"-compatible, Range is not.
This is a bug which looks to have been introduced by [edd638f], where
getRangeAt(0)
was replaced with acreateRange
routine.The issue is that if you select some text backwards, i.e. anchorNode is after focusNode, the range will be empty, because although Selection is "backwards"-compatible, Range is not.
Here's a JSbin which demonstrates the issue: http://jsbin.com/wujuropeye/1/edit?html,js,output