Page MenuHomePhabricator

It is possible to get the cursor into a block slug
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. In VE standalone, edit the document '<hr>x'. Observe the model selection is Linear 3-3.
  2. Click to the left of the horizontal rule. Observe:
    • the model selection changes to Linear 0-0;
    • the block slug above the horizontal rule activates; and
    • the DOM selection (see window.getSelection().focusNode) is the paste target.
  3. Click again in the same place. Observe the model selection remains Linear 0-0.

Expected behaviour: The DOM selection is the paste target
Observed behaviour: The DOM selection is the 'Insert paragraph' text node inside the block slug

This is because the code to move the DOM selection out of a block slug and into the paste target is in ve.dm.Surface#onModelSelect, which only gets triggered if the model selection has changed.

Event Timeline

dchan created this task.Aug 9 2018, 10:02 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 9 2018, 10:02 AM

Change 451605 had a related patch set uploaded (by Divec; owner: Divec):
[VisualEditor/VisualEditor@master] Move DOM selection from block slug even if model selection is unchanged

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

Change 451605 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Move DOM selection from a block slug even if model selection is unchanged

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

Change 452831 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (e7fd43cfb)

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

Change 452831 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (e7fd43cfb)

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

Deskana triaged this task as Normal priority.Aug 17 2018, 9:28 AM
Deskana closed this task as Resolved.Nov 2 2018, 2:28 PM