Skip to main content

New answers tagged

1 vote
Accepted

Drag and Drop Widgets within QScrollArea in PyQt6 Not Working Correctly

Most UI toolkits and graphics related software are based on the concepts of relative coordinate systems and parent/child relations (which is common in OOP). Your first attempt is invalid, because the ...
musicamante's user avatar
  • 46.4k
1 vote

WPF Drag and drop - System.InvalidOperationException. Dispatcher processing has been suspended, but messages are still being processed

In your repro project you're using TextBox but you made them all read only. If you really don't need them to be able to be changed then use a TextBlock and the exception goes away. I had a similar ...
William Randlett's user avatar
0 votes

Reactflow, how to make custom nodes as droppable areas for draggable elements

You can use Dropzone. import React, { useState, DragEvent } from 'react'; import { Paper, Typography, IconButton, Divider, Fab, Box, styled } from '@mui/material'; import DeleteIcon from '@mui/icons-...
Elialber Lopes's user avatar
0 votes

Angular Drag & Drop with nested section and subsection

As stated here: If you have an unknown number of connected drop lists, you can use the cdkDropListGroup directive to set up the connection automatically. Note that any new cdkDropList that is added ...
Andriy's user avatar
  • 15.2k
0 votes

Combining item replacement and reordering in SwiftUI List using onDrag and onDrop and onMove

Instead of using .onDrag use .itemProvider. That seems to be the magic after hours of trial and error.
Gary Caldwell's user avatar
0 votes

Dndkit how to force an item to remain in place in a vertical sortable list? (Also open to using other dnd libraries)

All modern dnd libraries would probably require changing source code for an ergonomic solution. The best option for this seems to be Jquery sortable lists: Forcing an item to remain in place in a ...
tlietz's user avatar
  • 136
0 votes

WPF Drag and drop - System.InvalidOperationException. Dispatcher processing has been suspended, but messages are still being processed

Your event handlers interfere with the default behaviour of the TextBox control. The easiest way to work around this by opting out of the default behaviour would be to set the Handled property of the ...
mm8's user avatar
  • 168k
0 votes

WPF Drag and drop - System.InvalidOperationException. Dispatcher processing has been suspended, but messages are still being processed

Hi I think problem is in the Dispatcher.Invoke call could you please try direct call the method DragDrop.DoDragDrop without calling from UI Thread , Its create issue may be that cause the ...
Abhishek khatri's user avatar
0 votes

How to disable iOS 11 and iOS 12 Drag & Drop in WKWebView?

In my opinion, even after applying allowsLinkPreview=false on the web view page, I understood that dragging occurred when assuming an image with a link. Here's how I resolved it: Targeting only macOS, ...
I have a question's user avatar
0 votes

event.dataTransfer.files is empty when ondrop is fired?

So, I was REALLY annoyed by this behavior. So I came up with a little loop, that basically clones the whole object: const seen = new WeakSet() const parseObj = (obj) => { const newObj = {} ...
Fuzzyma's user avatar
  • 8,264
0 votes

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

This answer is based on the accepted answer but uses promises. The code is extremely clean and has been thoroughly tested. It uses deferred promises (using p-defer) to avoid the need to wrap code in a ...
danday74's user avatar
  • 55.4k
1 vote
Accepted

Cannot drag again after dropping an element

I hope I understood the problem. The drag gesture's translation property shows how much it moved from current position. So just setting it to offset causes it to snap back to (0, 0) in the start. So ...
Radioactive's user avatar
0 votes

Dnd-kit transition doesn't work on drop of draggable item

use a state and useEffect to track drag ending. const { attributes, listeners, setNodeRef, transform, isDragging, active } = useDraggable({id}); const [style, setStyle] = useState({}); useEffect(() ...
Yasin's user avatar
  • 315
0 votes

How to detect the dragleave event in Firefox when dragging outside the window

Here's an event handler for window:dragleave which detects if something is dragged outside the window onDragLeave(evt: DragEvent) { const draggedOffScreen: boolean = evt.screenX === 0 && evt....
danday74's user avatar
  • 55.4k
0 votes

Is it possible to use the HTML5 Drag and drop API with JSON and JavaScript?

You can just add the event listener to a parent element, like #narrow. The event target will still be the image, because it is the only element that you allowed being dragged. Btw.: Don't define ...
chrwahl's user avatar
  • 11.6k
1 vote

Drag and drop in WPF on .NET 8 / C# does not work - bug in framework?

Ok, I have a solution for this problem. It's simple: Replace all your _DragOver events with _PreviewDragOver Replace all your _Drop events with _PreviewDrop Apparently, DragOver & Drop events are ...
MC9000's user avatar
  • 2,300

Top 50 recent answers are included