Explorar o código

handle v-for anchor position when moved by external lib (fix #2745)

Evan You %!s(int64=10) %!d(string=hai) anos
pai
achega
2486a3b85e
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      src/directives/public/for.js

+ 8 - 1
src/directives/public/for.js

@@ -332,7 +332,14 @@ const vFor = {
       })
       setTimeout(op, staggerAmount)
     } else {
-      frag.before(prevEl.nextSibling)
+      var target = prevEl.nextSibling
+      if (!target) {
+        // reset end anchor position in case the position was messed up
+        // by an external drag-n-drop library.
+        after(this.end, prevEl)
+        target = this.end
+      }
+      frag.before(target)
     }
   },