Alfred-Skyblue / vue-draggable-plus

Universal Drag-and-Drop Component Supporting both Vue 3 and Vue 2
https://vue-draggable-plus.pages.dev/en/
MIT License
2.74k stars 106 forks source link

Strange effect when dragging to an empty list #43

Open spyderdsn opened 10 months ago

spyderdsn commented 10 months ago

ezgif com-optimize

I noticed, when I have a list group and drag an item to an empty list, there is a fly back effect on the item dragged. This does not happen aways.

  1. When I drag the item slowly the issue does not occur.
  2. When both list have at least one item, the issue does not occur.

Any idea what I can do with it? Thanks

Alfred-Skyblue commented 10 months ago

I'm sorry, but I can't reproduce your issue. Could you provide a demo for reproduction, please?

https://github.com/Alfred-Skyblue/vue-draggable-plus/assets/55641773/66563ce8-6e7b-4c56-b3ee-1421e89a2c1e

moussaab-moulim commented 6 months ago

ezgif com-optimize ezgif com-optimize

I noticed, when I have a list group and drag an item to an empty list, there is a fly back effect on the item dragged. This does not happen aways.

  1. When I drag the item slowly the issue does not occur.
  2. When both list have at least one item, the issue does not occur.

Any idea what I can do with it? Thanks

i think the reason is on an empty list you have a 0 height section try to add a min-height of like 20px when the list is empty

spyderdsn commented 6 months ago

Hi, @moussaab-moulim @Alfred-Skyblue you can test my implementation in this Chrome extension. I tried to increase the height without the luck.

https://chromewebstore.google.com/detail/linkfolio-ai-personalised/pdhgolbhkdmkdeamfiikhkjopffadaea

BDW, I also experienced the issue mentioned here: https://github.com/Alfred-Skyblue/vue-draggable-plus/issues/45 When a new item is added to the list and then immediately dragged to another list or reorganised it can simply disappear.

Thanks

moussaab-moulim commented 6 months ago

can you provide a working codesandbox, i dont want to install an extension

spyderdsn commented 6 months ago

can you provide a working codesandbox, i don't want to install an extension

It will take me a day to isolate the code and prepare for code sandbox, it takes a minute to install the extension and is safe and you can remove it afterwards.