Page MenuHomePhabricator

Chrome issue with inserting character in the wrong position
Closed, InvalidPublic


Bug reported at:

@PrimeHunter writes (the clearest explanation):

If I insert a new line in Chrome and click {{DEFAULTSORT:}} or something else then it's inserted in the line above the cursor. If I insert 5 new lines and click then it's inserted 5 lines above, and so on. I can also reproduce the problem reported here. If I backspace 5 characters and click a symbol to insert something then it's inserted 5 charaters to the right, and so on.

To reproduce:

  • Using Chrome/Chromium (v.58 tested), open a page in 2010 wikitext mode. (E.g.)
  • Place the cursor so that there is text before and after it.
  • Tap <backspace> once
  • Use the Edittools selection to insert a character.
  • Observe that the character was not placed where it should've been, but instead was placed one character to the right.

Event Timeline

Quiddity renamed this task from Chrome issue with inserting character in the wrong position after backspacing to Chrome issue with inserting character in the wrong position.May 31 2017, 5:28 PM
Quiddity updated the task description. (Show Details)
Quiddity updated the task description. (Show Details)

I can reproduce this at Frwiki and, too.

This behavior is handled by the jquery.textSelection plugin. Cursory inspection indicates that for some reason the textarea returns an 'old' value for selectionStart If i manually query the value, it's correct all the time, but when i hit that insert button and then query the value, the value returned by Chrome seems incorrect or outdated for some reason..

Suspect this is a Google Chrome upstream issue. Found this user report!topic/chrome/-fcpPcwMAW4;context-place=forum/chrome which details a similar problem.

I was not able to reproduce in Chrome v61, so this might be specific to Chrome v58, in which case we will just have to sit this out until the new stable version is released.

If another person can confirm the v58 specificness of the problem, I think we can close the issue.