Page MenuHomePhabricator

Unable to place cursor or type after reference at end of line
Open, Needs TriagePublic

Description

I encountered this issue while editing on Wikipedia, and have since reproduced it on mediawiki.org on a simple almost empty page to help eliminate most factors from the issue.

Steps:

  1. Edit a page that has a first paragraph with a reference in it, and some words after that reference. Example: https://www.mediawiki.org/w/index.php?title=Project:Sandbox&oldid=4346667
  2. Remove those words.
  3. Observe the cursor is now nowhere, not blinking. Although if you're quick you can still type and despite no cursor, the text does go to where the cursor was last seen and is thought to be.
  4. If you click to where you think the cursor is, nothing happens visually (the blinking blinking cursor does not come back, nor does it appear elsewhere), but beneath the surface it seems this has severed the connection with our known universe. Any further typing now goes nowhere.

Notes

Clicking into where you already are may seem odd, but it made sense for two reasons as a user. 1) The cursor dissappeared, so I clicked in an attempt to resurrect it. 2) The issue also happens in the perhaps more common scenario where you first succesfully move the cursor elsewhere in the page and make changes, and then come back later to the earlier sentence that now ends with a reference.

Attachment

capture.gif (354×813 px, 582 KB)

Done

  • Before closing this task, check to ensure whether T273781 is still happening

Event Timeline

matmarex subscribed.

I can reproduce this in Firefox, but not in Chrome.

This is due to a Firefox issue. A minimal test case for it is:

data:text/html,<div contenteditable><p>FOO<span contenteditable="false">xxx</span>BAR</p><p>BAZ</p></div>

Selecting and deleting BAR leaves the cursor at offset 2 of the P node (so typing works), but invisible.

Subsequently clicking away then back again leaves the cursor inside the contenteditable=false span, so typing doesn't work.

Investigating further.

This should be fixed ASAP. When I copy a paragraph to another place the reference in the end of paragraph is not copied at all.
The problem only occurs in Firefox.

Change 883190 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[VisualEditor/VisualEditor@master] Try to prevent selections inside ref/template nodes on Firefox

https://gerrit.wikimedia.org/r/883190

Change 883190 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Try to prevent selections inside ref/template nodes on Firefox

https://gerrit.wikimedia.org/r/883190

Change 887326 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (109c9a606)

https://gerrit.wikimedia.org/r/887326

Change 887326 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (109c9a606)

https://gerrit.wikimedia.org/r/887326

matmarex added a project: Editing QA.

The change may not completely fix the issue, and there may be other issues related to text cursor movement near focusable nodes. If you have some time, it'd be nice to explore around a little bit and report what you find, in different browsers as well. Issues in T272207, T313162 and T327086 are all probably related.

The cursor moves towards the end of the line when you click on the line, however, it places the cursor before the element at the end of the line:

matmarex removed a project: Editing QA.

Changes were reverted due to causing T329983 and T330104.