Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refreshing an array #53

Open
yvahava opened this issue Jun 14, 2022 · 2 comments
Open

Refreshing an array #53

yvahava opened this issue Jun 14, 2022 · 2 comments
Labels
question Further information is requested

Comments

@yvahava
Copy link

yvahava commented Jun 14, 2022

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.

@amendx
Copy link
Owner

amendx commented Jun 14, 2022

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 amendx added the question Further information is requested label Jun 14, 2022
@yvahava
Copy link
Author

yvahava commented Jun 28, 2022

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'"
      >

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants