Page MenuHomePhabricator

VisualEditor: First character in empty document behaves strangely in Firefox
Closed, ResolvedPublic


Steps to reproduce:

  1. Go to a nonexistent page
  2. Click the Create tab
  3. Type "foobar"

Result: "f" appears on a line by itself, "oobar" appears on the next line. The document model only contains "oobar". The "f" jumps around when rerendering (e.g. when you press enter).

Can NOT be reproduced if:

  • you use Chrome
  • you click out of the editor and back into it before typing
  • you press Ctrl+A, Backspace before typing text

The editor document looks like this:

<div contentEditable="true"><p><span class="slug"></span></p></div>

I think the cause of this bug is that Firefox initially puts the cursor before the <p>, rather than inside the <p> or inside the <span>.

Version: unspecified
Severity: normal