Page MenuHomePhabricator

Sporadic off-by-N cursor bug in source editor, Vector/Chrome, on Mac and Android
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • In Vector (before and after 2022, but noticed more often this year): "Edit source" for a page or section.
  • At some point (in 1/10 to 1/100 edits), the cursor will start to appear one character before its actual position. E.g., for a 10-character line, the cursor will only reach the 9th character; deleting from that point will delete the 10th character.

What happens?:

  • Once this bug is triggered, clicking anywhere in the editing screen will have the same problm. To correct the typo in the previous sentence, you'd have to put your curser between "b" and "l" in "problm" and type "e".
  • Reloading the editing page, or moving to a different page and editing it, generally resolves the issue. However if you're in the middle of an edit, this often causes a typo and makes it hard to correct or complete it without further mistakes.
  • On at least one occasions, while soldiering on to finish an edit, I've seen this escalate to an "off-by-2" bug.
  • On other occasions, I've seen a version of this which is a vertical off-by-1 bug, with text rending one line off from where the cursor (and invisible text it is acting on) render.

In those cases,

if you wanted to place my cursor after the word "cases," above, you would click below it on the blank line, where the cursor would gamely extend out 15 spaces (for the 15 characters in the previous line), and could edit the short line from there. Similarly, it would be impossible to place a cursor anywhere on the first line of this current paragraph, as in cursor-world that's the blank line containing no characters.

What should have happened instead?:

  • Normal editing.

Other information (browser name/version, screenshots, etc.):

Experienced in Desktop-mode Chrome/Android, and in Chrome/Mac, while logged in.

NB: possibly related to T188839.

Event Timeline

Jdlrobson-WMF raised the priority of this task from Low to Needs Triage.Apr 24 2025, 3:00 PM
Jdlrobson-WMF added a project: VisualEditor.
Jdlrobson-WMF moved this task from Needs triage to Tracking on the Vector (legacy skin) board.

@Jdlrobson-WMF just a note, this still happens in Vector 2022. (and I've continued to run across it infrequently, mainly in Chrome / MacOS 12 up to OS 15)