Skip to content

how to prevent snap-back animation when dragging an item and dropping it outside to remove it ? #218

@dd-ssc

Description

@dd-ssc

I find it absurdly hard to get started with pragmatic drag and drop and super frustrating to get anywhere with it 😞

I have spent the last 2 weeks reading most of the documentation and working through the tutorial and some of the examples - but they are bloated with code that has nothing to do with prag dnd, but only distracts and raises more questions - and I still feel like a complete idiot 🤯

Still, I managed to implement some of the drag & drop use cases in my application:
I have items (i.e. React components with draggable) and drop zones (i.e. React components with dropTargetForElements).

  1. I can drag items in from "outside" (i.e. from React components not connected with prag dnd in any way) and drop them in a drop zone
  2. I can drag and drop items between drop zones
  3. I can drag items from a drop zone and drop it "outside" (see point 1) to remove them

However, when I do point 3, I see some animation that moves the item back to the location it was dragged from before it disappears.

I've been trying to fix this using Copilot, but that just misses the point; it screws around hiding the item while it is being dragged (or removing it from the DOM), but none of that seems to change anything about that snap-back animation.

How can I fix that ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions