marijnh/CodeMirror2 — Issue #332: Mac Safari - dragging selected text crashes the browser
Author: joshpangell
Created: 2012-01-18 19:28:32+00:00
State: open

In the latest version of Safari — Version 5.1.2 (7534.52.7) — if you highlight a piece of code, then attempt to drag it, Safari's default crash happens. The default crash looks like a page refresh. I do not have any older versions of Safari to test on, so I can't speak to that. This does not happen on any other browsers that I've tested (Chrome, Firefox, Opera, IE).

To reproduce:
1. In Safari open any CodeMirror example page, such as [Auto-Resize Demo](http://codemirror.net/demo/resize.html)
2. Highlight a section of code
3. Click on the highlighted code and attempt to drag anywhere in the editor

I've attempted to debug this by setting a breakpoint on the `onDragStart` function. Sometimes it will crash inside of this function, other times it will continue and crash on the `wrapHandler` function.

It is difficult to tell what is going on because Safari is simply refreshing the page, so any data that might be gleaned is lost in that refresh.

P.S. Thanks for an awesome app!