ng2-dnd icon indicating copy to clipboard operation
ng2-dnd copied to clipboard

Add allowFileDrop functionality to dnd-sortable-container

Open DzmVasileusky opened this issue 7 years ago • 1 comments

  • I'm submitting a ... [x] feature request

  • What is the current behavior? Currently all directives which extend AbstractComponent bind handlers to 'drop' event. And inside handler there is event.stopPropagation call which prevents bubbling. It breaks integration with packages like ng2-file-upload which also have subscription to 'drop' event. I want to use drag and drop only to sort HTMLElements but it also handles all the file drops. dnd-sortable-container has no allowDrop binding so I can't switch off stopPropagation method.

  • What is the expected behavior? allowDrop is working for dnd-sortable-container and disable drop or allowFileDrop for all the directives to disable file drop handling

DzmVasileusky avatar Jul 27 '18 16:07 DzmVasileusky

I do not consider this as a feature request, but as a bug. We have a similar issue reported against our application, also based on both ng2-dnd (2.2.1) and ng2-file-upload (1.3.0).

Which version are you experiencing this with? In our case, file drops remain possible, but some are impossible. Specifically, files from Chromium's Downloads (recent downloads) cannot be dragged to an ng2FileDrop inside a dnd-sortable-container. Files from other sources (for example, from the desktop) can be. Even files from Firefox's Downloads can be dragged to a Chrome tab using dnd-sortable-container. This affects presumably all browsers based on Blink, including Google Chrome 92.0.4515.131 and Microsoft Edge 92.0.902.67. The problem is not just the drop event's handling. Currently, when hovering the container, the cursor becomes a black standard prohibited sign (in not-allowed's style). Our records suggests this wasn't the case before (perhaps with prior Blink versions).

Chealer avatar Aug 10 '21 20:08 Chealer