Page MenuHomePhabricator

CodeEditor's drag and drop only works after a small delay
Closed, ResolvedPublic

Description

Dragging and dropping text (as an alternative to keyboard or context menu copy and paste commands) inside CodeEditor does not work.

Since this is basic functionality in every other editor I know this should also be supported by CodeEditor.


Version: unspecified
Severity: enhancement
See Also:
https://github.com/ajaxorg/ace/issues/1879

Details

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:02 AM
bzimport added projects: CodeEditor, Upstream.
bzimport set Reference to bz60432.
bzimport added a subscriber: Unknown Object (MLST).

This works for me in the beta at least: http://en.wikipedia.beta.wmflabs.org/w/index.php?title=Module:HtmlBuilder&action=edit

It might be that the reporter is actually talking about VisualEditor, which indeed does not seem to support drag and drop of text.

No this definitely is about CodeEditor!

And while I just wanted to write that this is definitely not fixed I just realized during some additional testing that it actually is working... but only somehow.

I don't know if I have a very special way of dragging/dropping but actually dragging only starts after a small delay (note that after clicking highlighted text the cursor only changes to the move cursor after approx. 100 ms). If you start moving the mouse before it will just create a new selection.
However when normally dragging/dropping I start moving the mouse right away. Moving the mouse over the highlighted text, clicking, then *waiting* and only after waiting beginning to move the mouse is just counterintuitive and different from every other program I know.

Since it therefore doesn't seem to be specific to MediaWiki's implementation (Ace's web demo "works" exactly the same) I'll report a bug for Ace directly however. I'll update this bug with the respective info then.

Upstream bug is https://github.com/ajaxorg/ace/issues/1879

Let's hope it is easy fixable and not some sort of technical limitation.

Thank you for clarifying Eduard !

So as answered in the linked upstream bug it seems this delay is actually configurable.

Nighwing wrote:
You can disable dragDelay by setting editor.setOption("dragDelay", 0)

Can somebody familiar with CodeEditor implement this? I can't see a reason to keep the delay at this point.

Change 121044 had a related patch set uploaded by TheDJ:
Remove CodeEditor delay in drag & drop of text

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

i still need to wrap this in some platform dependent if constructs.

Very nice! Thank you for the submission.

Has been fixed upstream (thanks Derk-Jan):
https://github.com/ajaxorg/ace/commit/63f43da96a1bd2b9894c371fb0feed7e38ef34d6

Let's wait until this fix makes it into MediaWiki's CodeEditor extension...

Change 121044 abandoned by TheDJ:
Remove CodeEditor delay in drag & drop of text

Reason:
Fix added upstream.

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

Fixed upstream. I'll schedule an update of the code sometime next week.

Change 144780 had a related patch set uploaded by TheDJ:
Ace: Update to 08-07-2014

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

Change 144780 had a related patch set uploaded (by Paladox):
Ace: Update to 08-07-2014

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

Patch-For-Review

Change 144780 merged by Brion VIBBER:
Ace: Update to 2015-01-28

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

Paladox closed this task as Resolved.EditedJan 30 2015, 10:34 PM
Paladox assigned this task to brion.
Paladox subscribed.

I carnt set multiple assigned to by TheDj is also included.