Page MenuHomePhabricator

VisualEditor: Using forward-delete key on a PC causes odd cursor placement
Closed, ResolvedPublic

Description

Steps to Reproduce:
From Deryck at mw:VisualEditor/Feedback:

Suppose I have:

A foobar B
C foobar D
E foobar F

foobarbaz

foobar

  • When I hit delete at B, the paragraph break is removed correctly, but the cursor jumps to the beginning of the previous paragraph (A).
  • When I hit delete at D, the paragraph break is also removed correctly, but the cursor jumps to or the right-hand side margin of the paragraph before that (to the right of B).
  • Sometimes the paragraph break is removed, and the first letter of the next paragraph is moved to the beginning of the previous paragraph (can't figure out the conditions of this, only observed it once and can't replicate it).
  • When I hit delete at F (just before a section header), the section header disappears... this might be the correct behaviour, but sadly hitting Ctrl+Z does not restore the section header.

Reproducible: Didn't try


Version: unspecified
Severity: normal

Details

Reference
bz58221

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:34 AM
bzimport added a project: VisualEditor.
bzimport set Reference to bz58221.

The sequence above was performed on Firefox on Win7.


I've tried reproducing this on Firefox 25 on Ubuntu 12.04. Errors occur at all 3 locations for which errors have been described:

The position of the cursor after hitting delete is unpredictable (read: Deryck has seen a few different outcomes and doesn't have enough time to exhaust all the possibilities); occasionally it even goes to the correct place.

The "eating up" of the next (sometimes even previous) paragraph only occurs if you start inserting text immediately after hitting delete. If you click anywhere in the textbox or hit the arrow keys on the keyboard, no text is corrupted.

Hitting Ctrl+Z after these errors yields unpredictable behaviour (same meaning of "unpredictable").

Similar, scary things happen at fr.wp, as reported by VEditors there.

Just a few examples:
0. Try to VEdit https://fr.wikipedia.org/wiki/Utilisateur:Elitre_(WMF)/Prove .

  1. Hit Del right next to "blabla".
  2. Notice the cursor is now on the top left margin of the page.
  3. Hit any key, say "w". I now have two more lines in my section, the first with a "b" on it, the second with a "w".
  4. Wait for some seconds. Watch as a "b" gets magically added to the header title.

0. VEdit the page again.

  1. Hit Del right next to "Hawker Siddeley Andover".
  2. Hit any key, say "w". Watch as a pawn appears on the previous line, and both the letter and the pawn multiply after a few seconds.

Another example:

In https://en.wikipedia.org/w/index.php?oldid=616866203&veaction=edit , place the cursor left of "F" in the word "Former" in the first paragrah, and hit the delete key. The "F" is deleted correctly, but the cursor jumps two to the left (between "s" and ".").

Reproduced in Firefox and Chromium under Ubuntu 14.04.

The original issue(s) appear(s) to be fixed. The issue spotted by Tilman has been filed as bug 67985.