Page MenuHomePhabricator

Cannot copy text when dm.surface.enabled === false
Closed, DeclinedPublic

Description

Author: ryan.wold

Description:
When disabling an Editor's .target.surface (by calling .disable()), the text is no longer editable, which is great. However, the text in the disabled Editor cannot be copied and pasted. It does not appear to make it to the clipboard.

Desired behavior is that the text can be be copied even when the editor is disabled. Or perhaps there could be a setting/option around that.

We traced this to ve.dm.Surface.prototype.changeInternal, where it returns immediately if the surface is disabled.

if ( !this.enabled ) {

return;

}

I found this here: https://doc.wikimedia.org/VisualEditor/master/source/ve.dm.Surface.html#ve-dm-Surface-method-changeInternal

I'm using OSX Mavericks and Google Chrome Version 36.0.1985.125.

Thanks!

  • Ryan Wold ryan.wold@neo.com

Version: unspecified
Severity: normal

Details

Reference
bz69515

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:27 AM
bzimport set Reference to bz69515.

ryan.wold wrote:

*** Bug 69516 has been marked as a duplicate of this bug. ***

The surface model also tracks selections so disabling the surface model would also disable any meaningful copy/paste functionality. dm.Surface#disable is not really intended for putting the surface into a useful read-only mode. What exactly are you trying to achieve?