Page MenuHomePhabricator

VisualEditor: Editor incorrectly selects slug and infobox onload
Closed, ResolvedPublic

Description

Details

Reference
bz54446

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:09 AM
bzimport set Reference to bz54446.

Created attachment 13347
Screenshot of page after trying to Undo

Causes loss of data as it makes it really easy to accidentally delete that selection when you start typing.

When you then try to do Undo, the following exception is thrown:

Uncaught Error: Cannot roll back a transaction that has not been committed

Also, for some reason the font has become noticably smaller (only in the affected paragraph; see screenshot)

Attached:

Screen_Shot_2013-09-22_at_9.26.26_AM.png (946×2 px, 302 KB)

This is cause by ve.ce.Surface#showSelection not being aware of the slug at the start of the document. Also, because the focusableNode logic takes places before showSelection is called, it tries to do a native selection.

Change 85866 had a related patch set uploaded by Esanders:
Detect collapsed range inside focusable node in ve.ce.Surface#onChange

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

Change 85866 merged by jenkins-bot:
Detect collapsed range inside focusable node in ve.ce.Surface#onChange

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