Page MenuHomePhabricator

Pasting list items in VisualEditor results in confusing behavior
Closed, ResolvedPublic

Description

Create a bullet list containing:

  • {{Done}} One
  • Two
  • Three

(where {{Done}} is the template). Then select and cut the first bullet, and try to paste it between Two and Three. The result is a mess, looking roughly like this in the editor:

  • Two
  • _
    • {{Done}} One

Three

(where _ is actually blank)

But after saving, it looks like:

  • Two
    • {{Done}} One
    • Three

I set up an example here: https://www.mediawiki.org/wiki/User:KSmith_%28WMF%29/test

Event Timeline

ksmith raised the priority of this task from to Needs Triage.
ksmith updated the task description. (Show Details)
ksmith added a project: VisualEditor.
ksmith subscribed.
Jdforrester-WMF changed the task status from Open to Stalled.Feb 9 2016, 8:27 PM
Jdforrester-WMF subscribed.

This is expected behaviour. The content you cut and pasted was not just "a bullet", it was the start of a list. Pasting a list into a list inserts it as a sub-list rather than merging the content, per user requests previously. We could revisit this, but it'd be awkward to invert the expectation here. The empty line is called a slug and is required to let you insert something else ahead of the sub-list (such as an image), but disappears on edit.

But what about the "Three" appearing on a separate line, rather than on a bullet line?

The argument that selecting the first bullet is "selecting a list" rather than "selecting a bullet" makes sense from a technical standpoint, but not really from a user standpoint. I'm pretty sure every other bullet point editor I have used allows you to move the first bullet to a lower position in the same list, without indenting it. Gmail and google docs certainly allow it.

Copying a single list item no longer "selects the bullet", so it simply pastes as normal text. This results in more intuitive behavior; for example, copying a list item and then pasting it into an empty list item just results in duplicating the same list item.

However, it's still possible to produce similar unintuitive behavior by copying and pasting multiple list items at once.

nshahquinn renamed this task from Pasting bullets containing templates indents incorrectly to Pasting list items in VisualEditor results in confusing behavior.Sep 10 2019, 8:01 PM

Also, no template needs to be involved for this to happen.

nshahquinn claimed this task.

On second thought, the bug described here has been fixed.

I've filed the issue pasting multiple list items (which is Firefox-specific) as T232528.