Closed NicolaiHorlacher closed 1 month ago
Name | Link |
---|---|
Latest commit | 47a60c9550b5fd172a2ffaf5fcaa1616140c9e56 |
Latest deploy log | https://app.netlify.com/sites/vue-draggable-plus/deploys/664a1721bd01f200088437e4 |
Deploy Preview | https://deploy-preview-138--vue-draggable-plus.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Thanks!
close #77
Oh, didn't notice there was an issue already. Thanks for the quick merge.
When
onAdd
andonRemoved
is triggered the list got updated in-place. This leads to an undesired prop manipulation in theVueDraggable
component, because the writable computed that manages theupdate:model-value
emit isn't triggered trough in-place updates of arrays.The
onUpdate
method already had a fix to sidestep this behavior. So, I applied it toonAdd
andonRemoved
also.While testing I noticed that the
onRemove
method is reverting the SortableJS DOM manipulation only when clone mode is active. SortableJS removes the DOM element in any case, soinsertNodeAt
needs to be called outside of the if-statement.In conclusion:
These changes streamline the behavior of the composable with writable computeds and fixes missing
update:model-value
emits. By extension it's now possible to use the component with:model-value
when automatic updates of the list are not desired.