reppners / ngx-drag-drop

Angular directives using the native HTML Drag And Drop API
https://reppners.github.io/ngx-drag-drop/
BSD 3-Clause "New" or "Revised" License
307 stars 120 forks source link

Question - Is it possible to cancel/revert after a dropping an item #114

Closed vonAnden closed 2 years ago

vonAnden commented 2 years ago

Hi

Is it possible to ask the user to confirm the drag and drop after the user have dragged an item. Can I revert/cancel the drag and drop?

And if possible, how to do it?. Can the events dndMoved or dndEnd be used to trigger a dialog and if so, how to cancel the drag and drop it the user says no?

reppners commented 2 years ago

Since your application logic decides what should happen after the drop you may handle this as a successful drop as far as this library is concerned but conditionally fulfill the action you intend after your dialog result is available.

vonAnden commented 2 years ago

Thank you.

kiran-pathe commented 1 year ago

@reppners Can you provide a demo link how to cancel drop ? I am looking for an example where I can see an error toast in case of invalid drop and for successful drop, it should moved to dropzone.