Procházet zdrojové kódy

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

Evan You před 10 roky
rodič
revize
2486a3b85e
1 změnil soubory, kde provedl 8 přidání a 1 odebrání
  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)
     }
   },