vue-slicksort
vue-slicksort copied to clipboard
Error when one item is disabled
When one of the items is :disabled
and I try to move other items I get this error on sort end:
Uncaught TypeError: Cannot read property 'node' of undefined
at VueComponent.transitionHelperIntoPlace (vue-slicksort.umd.js?11b0:710)
at VueComponent.handleSortEnd (vue-slicksort.umd.js?11b0:692)
@Jexordexan I'm getting the same issue
Same problem here, it seems that the error occurs within the transitionHelperIntoPlace
function at var indexNode = nodes[this.index].node;
Because this.index
doesnt take into account the disabled element/s
ie. when dragging the last item in a list of 5, nodes.length = 5
and this.index = 4
after disabling one item, nodes.length = 4
and this.index = 4
Setting draggedSettlingDuration
to 0 will solve the error, but there will be no smooth "return to position" animation. So yea, this is a bug and it would be nice if it gets fixed.
I'm getting the same issue
:index should be given from v-for loop. if you give different index value then sorting doesn't work.
I also encountered the same problem and hope to solve it
Same here.
I found a solution, you need just change disabling logic, instead of removing nodes just skipping them in animation, works fine: https://github.com/Jexordexan/vue-slicksort/pull/170
Nevermind, this is a bad solution