Page MenuHomePhabricator

Pasting multiple list items in VisualEditor in Firefox results in incorrect display and saving
Open, Needs TriagePublic

Description

Steps to reproduce

  1. Create an unordered list.
  2. Open an empty list item by pressing return at the end of one of the lines.
  3. Copy multiple existing list items and paste it into the new empty one.
  4. The editor displays the pasted list items as a sublist, but with an incorrect double bullet:
    Screen Shot 2019-09-11 at 01.39.59.png (348×228 px, 14 KB)
  5. Save the page.
  6. The two pasted list items have disappeared; instead, only an empty list item (wikitext *) has been saved:
    Screen Shot 2019-09-11 at 01.43.54.png (678×2 px, 100 KB)

Found in Firefox 70.0b5 on macOS 10.14.6

Event Timeline

Esanders added subscribers: dchan, Esanders.

This happens when the selection starts in the slug above the list. Such a selection can't be created in Chrome, but in FF you can create it by selecting backwards and ending your selection above the list. The selection then starts at offset 0.

Indeed in this situation an exception is thrown on copy

TypeError: startNode is null ve.dm.Document.js:535:14
    shallowCloneFromRange http://localhost/VisualEditor/lib/ve/src/dm/ve.dm.Document.js:535
    shallowCloneFromSelection http://localhost/VisualEditor/lib/ve/src/dm/ve.dm.Document.js:446
    onCopy http://localhost/VisualEditor/lib/ve/src/ce/ve.ce.Surface.js:1929