Page MenuHomePhabricator

VE confused by select-all
Closed, ResolvedPublic1 Story Points

Description

Steps to reproduce:

  • visit https://en.wikipedia.beta.wmflabs.org/wiki/User:Tgr/sandbox?veaction=editsource (the bug seems to be specific to opening it via URL and not the edit button)
  • click outside the edit box (defocus it)
  • press ctrl-a - this will select everything in the page (not just in the editor, since the editing area is not focused at this point)
  • click into the edit box
  • press ctrl-a (this will select the wikitext only)
  • press del

The text will be deleted but NWE won't notice the change (save button stays grey, switching to VE will show old text).

I can reproduce this most of the time but not reliably. I think it depends on not waiting too much between the steps. (Could be something that's totally unrelated to the while selecting business, but that's how I noticed it.)

Tested with Chrome 55 / Ubuntu 16.04.

Event Timeline

Tgr created this task.Feb 7 2017, 9:26 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptFeb 7 2017, 9:26 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Esanders renamed this task from New wikitext editor confused by select-all to VE confused by select-all.Feb 8 2017, 9:44 PM
Esanders added a subscriber: Esanders.

Looks like clicking in the edit box after selecting around the edit box isn't causing the focus event to fire properly. Will affect all editor modes and break pretty much everything.

Jdforrester-WMF triaged this task as Unbreak Now! priority.Feb 8 2017, 9:59 PM
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Jdforrester-WMF set the point value for this task to 1.
Restricted Application added subscribers: Jay8g, TerraCodes. · View Herald TranscriptFeb 8 2017, 9:59 PM

Found the issue here:

When you click inside an existing selection (as you are doing by create a super-selection first), the selection doesn't change until mouseup, when you are moving a selection this change happens on mousedown which our code assumes. We actually listen to focusin, but that happens immediately after mousedown, not up.

Change 336812 had a related patch set uploaded (by Esanders):
Listen to mouseup events on documentNode for focus changes

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

Change 336812 merged by jenkins-bot:
Listen to mouseup events on documentNode for focus changes

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

Change 336899 had a related patch set uploaded (by Jforrester):
Update VE core submodule to master (0dfc50a88)

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

Change 336899 merged by jenkins-bot:
Update VE core submodule to master (de7a96ece)

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

Jdforrester-WMF closed this task as Resolved.
Jdforrester-WMF assigned this task to Esanders.