Range.startOffset gives wrong value

Confirmed Issue #14297319 • Assigned to Anupam S.


Nikx D.
Oct 19, 2017
This issue is public.
Found in
  • Microsoft Edge
Reported by 1 person

Sign in to watch or report this issue.

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.”

You need to sign in to your Microsoft account to add a comment.

Sign in