Steps to reproduce
I’m not exactly sure, if this is really a bug, because when reading the specs I just gave up and came to the conclusions, that RFCs aren’t intended to be read by humans. Joke aside, Edge behaves significantly different when compared to other browsers (including but not limited to Internet Explorer 11) here, up until a point where its behavior both makes only little sense and is somewhat unexpected.
Selecting the entire contents of a text node inside a
contenteditable-area yields a selection range start starts at the text node (
startOffset === 0), but ends in the containing parent node.
Select the word
Test by either clicking marking the entire word with the mouse or double click it, in both ways the entire word will be selected. In Edge, the range will end with the
endContainer being the
endOffset === 1 which equals "after the text node".
The selection range contains only the text node, starting with
startOffset === 0 to
endOffset === endContainer.textContent.length. This has been verified in:
- Internet Explorer 11
- Chrome 65 Beta
- Firefox 58
Edge is so far the only browser that yields this kind of range, other browsers have not been tested by me.
Comments and activity
- Microsoft Edge Team
Changed Assigned To to “James M.”
Changed Assigned To to “Grisha L.”
Changed Status to “Confirmed”