Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336650 - [editor][chrome] drag text messes the content in the editor
Summary: [editor][chrome] drag text messes the content in the editor
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: Orion
Classification: ECD
Component: Editor (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 339028 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-08 15:33 EST by Felipe Heidrich CLA
Modified: 2011-12-05 16:50 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felipe Heidrich CLA 2011-02-08 15:33:01 EST
0.2 M5 
Every now and then when I'm working on Chrome/windows I select text in the editor too fast and a text drag starts. The Editor is not prepared to handle this event and is left in an inconsistent state when drag ends (scroll all the lines out of screen and back fixes). The editor should stop this drag start from happening.

I have tried, to no avail, stop this event using:
  
el.draggable="false";
el.WebkitUserDrag="none";
el.ondragstart = function (e) {e.preventDefault(); return false;};

for el I tried clientDiv, line div, line child.

Setting draggable="false" causes selection to stop working, the other two (WebkitUserDrag/ondragstart) didn't do anything.
Comment 1 Boris Bokowski CLA 2011-02-25 14:55:42 EST
This happens to me every now and then too. I always get very scared and try to reload the page as soon as possible.
Comment 2 Silenio Quarti CLA 2011-02-25 15:59:57 EST
I have seen this as well.

It is not necessary to reload the page. The model still has the old text. You just need to redraw the visible lines by scrolling or arrowing up and down.
Comment 3 Felipe Heidrich CLA 2011-04-19 14:19:18 EDT
I think the next step here is to try to isolate this problem to a simpler html file and try to get help from chrome dev. This bug is really annoying to user on chrome.
Comment 4 Felipe Heidrich CLA 2011-04-19 14:29:40 EDT
Simon just had this problem on Safari/Windows too. This can be a webkit problem.
Comment 5 Silenio Quarti CLA 2011-04-20 11:33:33 EDT
I released changes that will prevent the text from being dropped. This will avoid messing up the contents of the editor. It does not prevent the drag from starting.

Somehow the dragstart event which we are hooking to stop the drag only happens after the mouse button is released. I believe this is a bug in chrome.
Comment 6 Simon Kaegi CLA 2011-04-20 23:28:36 EDT
Thanks Silenio! It's not perfect but a really great workaround. This was just killing me before.
Comment 7 Simon Kaegi CLA 2011-06-15 11:15:23 EDT
*** Bug 339028 has been marked as a duplicate of this bug. ***
Comment 8 Felipe Heidrich CLA 2011-12-05 16:50:55 EST
I think we can close this bug since we support drag&drop now.
If the user accidently executes a drag&drop the undo can be used to revert the change.

There is a bug in chrome where we can't stop some drag start events (in the case D&D is disabled), but fixing it is outside our scope (and we already stop to drop as an workaround).