Steps to reproduce
When having a content editable div element, and a span inside it, setting the cursor to the last position in the field manually will result in the startOffset being 1, instead of the actual position. Also, the startContainer property will change from [object Text] to [object HTMLSpanElement], so I suppose that this behaviour is due to a bug in the actual object wrapping or something.
I’ve built a CodePen to test the behaviour here:
Just set the cursor after the "A". All major browsers and even latest IE will report "All good.", Edge however will fail the test.
Comments and activity
I’ve updated the pen to “ABC” to make the issue more clear, because after the first char, the position would be 1 anyways.
- Microsoft Edge Team
Changed Assigned To to “Steven K.”
Changed Assigned To to “Grisha L.”
Changed Status to “Confirmed”
Changed Assigned To from “Grisha L.” to “Anand A.”
Changed Assigned To from “Anand A.” to “Anupam S.”