Page MenuHomePhabricator

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

Description

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 created this task.May 31 2017, 5:24 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 31 2017, 5:24 PM
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)
Quiddity updated the task description. (Show Details)May 31 2017, 5:32 PM
Quiddity added a subscriber: PrimeHunter.

I can reproduce this at Frwiki and mw.org, too.

TheDJ added a subscriber: TheDJ.May 31 2017, 8:27 PM

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 https://productforums.google.com/forum/?hl=sk&nomobile=true#!topic/chrome/-fcpPcwMAW4;context-place=forum/chrome which details a similar problem.

TheDJ added a comment.May 31 2017, 8:31 PM

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.

Fixed with Chrome 59.0.3071.86