Questions tagged [drag-and-drop]

It allows you to "grab" an object using the mouse and drag it to a different location. Drag and Drop can be done on browser-based application (web) or on native GUI applications like android or desktop

13309 questions
432
votes
41 answers

HTML5 dragleave fired when hovering a child element

The problem I'm having is that the dragleave event of an element is fired when hovering a child element of that element. Also, dragenter is not fired when hovering back the parent element again. I made a simplified fiddle:…
pimvdb
  • 151,816
  • 78
  • 307
  • 352
281
votes
10 answers

How do I drag and drop files into an application?

I've seen this done in Borland's Turbo C++ environment, but I'm not sure how to go about it for a C# application I'm working on. Are there best practices or gotchas to look out for?
Samuel Paul
236
votes
15 answers

drag drop files into standard html file input

These days we can drag & drop files into a special container and upload them with XHR 2. Many at a time. With live progress bars etc. Very cool stuff. Example here. But sometimes we don't want that much coolness. What I'd like is to drag & drop…
Rudie
  • 52,220
  • 42
  • 131
  • 173
230
votes
12 answers

Prevent browser from loading a drag-and-dropped file

I'm adding an html5 drag and drop uploader to my page. When a file is dropped into the upload area, everything works great. However, if I accidentally drop the file outside of the upload area, the browser loads the local file as if it is a new…
Travis
  • 2,303
  • 2
  • 14
  • 4
192
votes
22 answers

'dragleave' of parent element fires when dragging over children elements

Overview I have the following HTML structure and I've attached the dragenter and dragleave events to the
element.
Hristo
  • 45,559
  • 65
  • 163
  • 230
174
votes
7 answers

Is there a good jQuery Drag-and-drop file upload plugin?

Is there a nice tidy jQuery plugin that allows including a single JS script then using a simple snippet to enable a form? Something like this: $j('#MyForm').enableDragDropUploads('.upload-area') With the upload target being the action of the…
Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
172
votes
18 answers

How do I remove a file from the FileList

I'm building a drag-and-drop-to-upload web application using HTML5, and I'm dropping the files onto a div and of course fetching the dataTransfer object, which gives me the FileList. Now I want to remove some of the files, but I don't know how, or…
Michael Heilemann
  • 2,627
  • 4
  • 23
  • 28
136
votes
10 answers

Make WPF window draggable, no matter what element is clicked

My question is 2 fold, and I am hoping there are easier solutions to both provided by WPF rather than the standard solutions from WinForms (which Christophe Geers provided, before I've made this clarification). First, is there a way to make Window…
Alex K
  • 10,835
  • 8
  • 29
  • 34
135
votes
3 answers

Drag and drop files into WPF

I need to drop an image file into my WPF application. I currently have a event firing when I drop the files in, but I don't know how what to do next. How do I get the Image? Is the sender object the image or the control? private void…
Eamonn McEvoy
  • 8,876
  • 14
  • 53
  • 83
118
votes
4 answers

Drop event not firing in chrome

It seems the drop event is not triggering when I would expect. I assume that the drop event fires when an element that is being dragged is releases above the target element, but this doesn't seem to the the case. What am I…
Mild Fuzz
  • 29,463
  • 31
  • 100
  • 148
103
votes
11 answers

Does HTML5 allow drag-drop upload of folders or a folder tree?

I haven't seen any examples that do this. Is this not allowed in the API spec? I am searching for an easy drag-drop solution for uploading an entire folder tree of photos.
michael
  • 4,377
  • 8
  • 47
  • 73
93
votes
8 answers

Basic Drag and Drop in iOS

I want to have a view in which there are vehicles driving around that the user can also drag and drop. What do you think is the best large-scale strategy for doing this? Is it best to get touch events from the views representing the vehicles, or…
Luke
  • 7,110
  • 6
  • 45
  • 74
87
votes
16 answers

Preventing click event with jQuery drag and drop

I have elements on the page which are draggable with jQuery. Do these elements have click event which navigates to another page (ordinary links for example). What is the best way to prevent click from firing on dropping such element while allowing…
85
votes
3 answers

Disable click and drag cut and paste in IntelliJ Idea IDE

In my IntelliJ Idea 13.1.2 IDE I keep running into situations where I'm selecting on a click and drag via my laptop touch pad. I keep accidentally clicking and dragging text and cutting lines. I've searched the options and settings panels for the…
Jason D
  • 8,023
  • 10
  • 33
  • 39
79
votes
7 answers

HTML5 Drag & Drop Change icon/cursor while dragging

I'm wondering how to change during dragging (dragover/dragenter) icon/cursor when I dragenter for example to deny or allow section. Of course, I can move with cursor a part of DOM positioned absolutely, but I'm interested in native HTML5…
Alex Ivasyuv
  • 8,585
  • 17
  • 72
  • 90
1
2 3
99 100