Skip to content
Advertisement

Tag: drag-and-drop

Drag & drop a file anywhere on a page

I have the following code: You can click on it to select a file. But alternatively you can drag a file and drop it on the Select file button. But you have to exactly hold the cursor above the button when dropping the file. Otherwise it won’t work. There are ways to make the button or the drop zone bigger.

Get src of dropped image from event target

I have a list of images that i can drap and drop, when dragging starts on image i store it’s URL in a state like this: When dropping it i use that state URL to display the image: But I was wondering if I could use the event e produced by onDrop to get the URL of the image, without

How do you use state variables to make a nested drag and drop in React / Kanban board not working in React

Context: The main issue I am trying to solve is that stopping the propagation on an onDragStart event handler (via e.stopPropagation()) is disabling the drag-drop functionality all together. However, when I try to set a flag in the state, to stop drag-drop events to fire on parent elements; the flag does not work/ the state does not set in time

Advertisement