Jexordexan / vue-slicksort

A set of vue mixins to turn any list into an animated, touch-friendly, sortable list ✌️
http://vue-slicksort.netlify.app
Other
1.48k stars 157 forks source link

[Bug] List with group + press-delay will remove item on click #161

Open DanSnow opened 2 years ago

DanSnow commented 2 years ago

Description

Example link: https://stackblitz.com/edit/vitejs-vite-n4debu?file=src%2FApp.vue&terminal=dev

Please see the video

https://user-images.githubusercontent.com/5575082/157005129-ed65728e-0170-4667-85f3-9a1153f63955.mp4

I think that we need to set the sortableGhost to null here: https://github.com/Jexordexan/vue-slicksort/blob/dev/src/ContainerMixin.ts#L655

Or it will be removed here: https://github.com/Jexordexan/vue-slicksort/blob/dev/src/ContainerMixin.ts#L515

Reproduce steps:

  1. click and hold on any item until its background color changed
  2. click on the same item again
lotestudio commented 2 years ago

I've tested the solution, but the bug still exists. Found that if rerender the list, everything is as expected: <SlickList v-model:list="..." group="..." :pressDelay="500" :key="componentKey" @sort-end="componentKey++" @contextmenu="$event.preventDefault()" "