vue-dndrop icon indicating copy to clipboard operation
vue-dndrop copied to clipboard

Refreshing an array

Open yvahava opened this issue 3 years ago • 2 comments

Hi. When I init the array for the first time, the drag and drop seems to work fine. However, when I refresh the array a second time, the drag and drop no longer works well. Viewing it within the 'onDrop', I can see that the dropElement has 'addedIndex' of null.

yvahava avatar Jun 14 '22 08:06 yvahava

Hi @yvahava can you record what weird behaviour you're experiencing? How are you refreshing the array?

Here on this example, you can see that after @drop the element fires:
image

amendx avatar Jun 14 '22 13:06 amendx

I have an array resultsData that is part of the v-for loop as you see below. I simply reassign the array to a new array object.

    <Container @drop="onDrop(resultsData, $event)" :should-accept-drop="shouldAcceptDrop">
      <Draggable
        v-for="(elementData, index) in resultsData"
        :key="headerData.id + index + '_stdElements'"
      >

yvahava avatar Jun 28 '22 12:06 yvahava