Skip to content

Commit f913c52

Browse files
Correcting issue #164
1 parent 227b8a5 commit f913c52

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vuedraggable.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424
return vnodes.map(elt => elt.elm).indexOf(element)
2525
}
2626

27-
function computeIndexes(slots, children) {
27+
function computeIndexes(slots, children, isTransition) {
2828
if (!slots) {
2929
return []
3030
}
3131

3232
const elmFromNodes = slots.map(elt => elt.elm);
33-
return [...children].map(elt => elmFromNodes.indexOf(elt))
33+
const rawIndexes = [...children].map(elt => elmFromNodes.indexOf(elt))
34+
return isTransition? rawIndexes.filter(ind => ind!==-1) : rawIndexes
3435
}
3536

3637
function emit(evtName, evtData) {
@@ -169,7 +170,7 @@
169170

170171
computeIndexes() {
171172
this.$nextTick(() => {
172-
this.visibleIndexes = computeIndexes(this.getChildrenNodes(), this.rootContainer.children)
173+
this.visibleIndexes = computeIndexes(this.getChildrenNodes(), this.rootContainer.children, this.transitionMode)
173174
})
174175
},
175176

0 commit comments

Comments
 (0)