Page MenuHomePhabricator

VisualEditor: Mouse up outside the surface doesn't register a selection change.
Closed, ResolvedPublic

Description

  1. Open up the standalone demo /empty.html and type some text
  2. Select text from right to left, mouse up outside the surface (or even outside the window)
  3. Although the text is selected in CE pressing dump range gives a collapsed range. Formatting actions will fail too.

Version: unspecified
Severity: normal

Details

Reference
bz59822

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:29 AM
bzimport set Reference to bz59822.

Perhaps we should be using document.onselectionchange to update the model selection (polyfill: https://github.com/2is10/selectionchange-polyfill)

Or just stop the surface observer from being disabled. We currently have a bug whereby if you create a selection on a blurred document the SO isn't disabled so you can see the range being periodically updated as you change the selection.

Change 159807 had a related patch set uploaded by Esanders:
Bound onDocumentMouseUp to the entire document on mousedown

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

Change 159807 merged by jenkins-bot:
Bind ve.ce.Surface#onDocumentMouseUp to the entire document on mousedown

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

Change 159919 had a related patch set uploaded by Esanders:
Trigger selection update on selectionchange or mousemove events

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

Change 159919 merged by jenkins-bot:
Trigger selection update on selectionchange or mousemove events

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

Verified the fix in production