bmcmahen / react-grid-dnd

drag and drop, grid edition. built with react

Home Page:https://codesandbox.io/embed/gracious-wozniak-kj9w8

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

disableDrop not working as intended

TheAifam5 opened this issue · comments

Hey!

While writing a program using that library I noticed that if the disableDrop is set, you can drag any item, which will move whole array and can be drop only on the last index. It does not work if the item (from the first GridDropZone) is dropped into another GridDropZone.

Example here:
https://codesandbox.io/s/reactgriddnd-example-bxpo7

How to repoduce:

  1. Drag any element n-1
  2. The list should move (but shoudn't)
  3. If you drop it, will land on the last index always.

Desired behaviour:
I think, the dragged element should go back to the index, where was dragged from.

Regards,
TheAifam5

Hmm interesting, I think you're right - if the dropzone has disableDrop and you start dragging from that dropzone, it should always return to its original point.

I'm curious what your use case is here, though. I never really envisioned someone wanting to disable dropping on both dropzones.