Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Fix Bug in Dragable example#2465

Closed
mleveck wants to merge 1 commit into
angular:masterfrom
mleveck:master
Closed

Fix Bug in Dragable example#2465
mleveck wants to merge 1 commit into
angular:masterfrom
mleveck:master

Conversation

@mleveck
Copy link
Copy Markdown

@mleveck mleveck commented Apr 21, 2013

Tested in Tested in latest Chrome 26.0.1410.65 for OS X
In the example with draggable, the mouseDown handler needs to start with an event.preventDefault(). Otherwise the following bug occurs:

  1. Select the text of the draggable span by clicking outside the span and dragging the mouse to the left or right through the span. Release the mouse button.
  2. Now click on the span's inner text, and start to Drag it. The browser's default functionality that drags highlighted text so that it can be pasted into something else (say a document in a text editor) is invoked.
  3. Release the mouse button. Now suddenly, you'll be dragging the span. But you won't be able to place it down on the page. It'll just follow the mouse around until the page is refreshed.

The added line fixes this.

petebacondarwin added a commit that referenced this pull request Apr 22, 2013
In the example with draggable, the mouseDown handler needs to start with an event.preventDefault(). Otherwise the following bug occurs:
1) Select the text of the draggable span by clicking outside the span and dragging the mouse to the left or right through the span. Release the mouse button.
2) Now click on the span's inner text, and start to Drag it. The browser's default functionality that drags highlighted text so that it can be pasted into something else (say a document in a text editor) is invoked.
3) Release the mouse button. Now suddenly, you'll be dragging the span. But you won't be able to place it down on the page. It'll just follow the mouse around until the page is refreshed.

Closes: #2465
petebacondarwin added a commit that referenced this pull request Apr 22, 2013
In the example with draggable, the mouseDown handler needs to start with an event.preventDefault(). Otherwise the following bug occurs:
1) Select the text of the draggable span by clicking outside the span and dragging the mouse to the left or right through the span. Release the mouse button.
2) Now click on the span's inner text, and start to Drag it. The browser's default functionality that drags highlighted text so that it can be pasted into something else (say a document in a text editor) is invoked.
3) Release the mouse button. Now suddenly, you'll be dragging the span. But you won't be able to place it down on the page. It'll just follow the mouse around until the page is refreshed.

Closes: #2465
@petebacondarwin
Copy link
Copy Markdown
Contributor

Actually this needs to go in the mousedown event. Landed as de296f1.
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants